I want to set a linear velocity of a dynamic object. But whenever I try to do it as in a single axis, it won’t work via Python - it is just zero speed, even though the object is dynamic.
Example of a code which should normally move anything provided there is a Motion actuator named “movement”:
import bge
import bge.logic as gl
cont = gl.getCurrentController()
own = cont.owner
movement = cont.actuators['movement']
movement.linV[0] = 3.0 # This doesn't even move the object at all for some reason
cont.activate(movement)
But if you run the sample code, it will not do any kind of movement, but printing out the linear velocity in the console shows the speed of the object, however it seems to be at nothing.
I really want to set an object so it goes along a single axis at a constant speed rather than using a tuple through the motion actuator’s linear velocity python. I even tried it using the location, still no luck. Why is it doing that?