Question by
TootNoot · Aug 22, 2021 at 08:22 AM ·
3daddforceaddforce movement
How to add force over time instead of it being instant?,How to add force over time?
Hello! I am trying to make a little infinite runner game but I am currently having troubles with the side to side movement. I have only gotten this AddForce movement to work but it is always moving the player instantly instead of it being moved over a time like half a second.
if(Input.GetKeyDown(KeyCode.A)){ playerRB.AddForce(-pushForce,0,0); } if(Input.GetKeyDown(KeyCode.D)){ playerRB.AddForce(pushForce,0,0); }
This is what I have right now and the only thing I could find that would work. If anyone knows how to make this go over time the help would be really appreciated, thank you.
Comment
Your answer
