need python help - property to linV

hi

i’m trying to make a game where a person can get in and out of a car. i decided to make the car non dynamic, and i need a good way to create smooth acceleration

can someone make a script for me which turns a property value into an objects linV value…

… this may sound kinda weird, but i want my velocity to be represented by a graph like “root X” if you know what i mean.

i already have a property called “gas”, maybe someone could help me root that and use it as my velocity

thanks for the help :smiley:

import GameLogic as GL
cont = GL.getCurrentController()
own = cont.getOwner()
key = cont.getSensor('sensor')
motion = cont.getActuator('act')
if key.isPositive():
	own.gas += 0.5
	motion.setLinearVelocity(0,own.gas,0,0)
	GL.addActiveActuator(motion,1)


Here’s it

… this may sound kinda weird, but i want my velocity to be represented by a graph like “root X” if you know what i mean. … this may sound kinda weird, but i want my velocity to be represented by a graph like “root X” if you know what i mean.

I don’t understand tat :expressionless:

when i said root X… i meant the oppost of something squared…
life root 4 = 2
how do i do a root sign in python??

import math
print math.sqrt(4.0)
print math.pow(4.0, 0.5) # slower probably

ah… thanks guys… :smiley: