Is there any way to control acceleration in the blender GE rather than just speed? I am wanting to create a realistic space combat where pressing a key fires your thrusters accelerating you indefinitely rather than just pushing you towards a max speed, and momentum is continued when you turn. Can I do this or do I need a python script?
If you set the object Damping to 0, your object will accelerate infinity with given thruster Force until the BGE crashes.
Is there a less glitchy way? My cube will oscillate and then shoot off in a direction.
If you know enough, you can do everything by hand using object.position. This gets very, very tedious, as you have to do everything by yourself.
That way you have the movement seperated into a vector (x, y, z) which you can use to move it. Then, when it comes to turning and stuff, you just add the vectors together (AFAIK). If you get the 3d part of the vectors working let me known, i’ve been struggling (should be easy, but it’s not :{).
Try this:
import GameLogic
cont = GameLogic.getCurrentController()
act = cont.getActuator(‘act’)
owner = cont.owner
sens = cont.getSensor(‘sensor’)
if sens.isPositive():
owner[‘speed’] = owner[‘speed’] + .001
elif owner[‘speed’] > 0:
owner[‘speed’] = owner[‘speed’] - .001
act.dLoc = [owner[‘speed’],0,0]
http://www.4shared.com/file/boI8vV8W/untitled.html
heres a link to a blend of it being used it
Awesome- this is what i’m looking for, but is there a way to make it not slow down?
yeah, go into the script, and delete the two lines:
elif owner[‘speed’] > 0:
owner[‘speed’] = owner[‘speed’] - .001
im not sure you would want that though, how would your craft ever slow down?
press a different key-- reverse thrusters.
Never mind my last post, but I have a new problem. My movement script and mouselook script face different directions. Anyone know how to fix this?
Hese is a .blend
newtonian.blend (315 KB)
rotate your camera -90 degrees around the cube so it matches with the script’s direction lol
I did that- but then when you move the mouse up and down it tilts back and forth
Hmm, I don’t know what you did with the mouselook script, but I myself whipped up a file that uses the arrow keys to turn. Maybe you should try to use them instead of a mouse?
http://www.4shared.com/file/nTFQNfxv/_2__untitled.html
btw, in the new script you can adjust the acceleration speed, deceleration speed (can be set to 0 if you don’t want any) and topspeed.
I got it fixed. but thanks.