Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | alskdjfhg |
I have a rigidbody that I move with
if Input.is_action_pressed(“Forward”):
add_central_force(to_global(Vector3(-100,0,0)))
if Input.is_action_pressed(“Left”):
add_central_force(to_global(Vector3(0,0,100)))
etc.
The problem is that when I move it left, right, up, or down it starts moving forward too, even though as far as I can tell there’s no reason for it to
can you supply more code and in “code format” to debug and forward is -x?
klaas | 2020-07-23 11:04
I’ve tested it … no forward movement in my case.
Are your sure that you dont messed up the keybindings?
Maybe you have the forward key bindet to the other directions too!?
klaas | 2020-07-23 19:14
The keybinds are all good, maybe it has something to do with the physics?
I’ve zipped up the game files and stuck that on the github, if anyone wants to take a look
alskdjfhg | 2020-07-23 19:53