Question by
SiimonSayss · Oct 25, 2017 at 02:40 PM ·
c#controllertop down shooterfast
Clunky movement in my top down shooter (w,a,s,d)
Hey Community,
I am currently working on a top-down-brawler-project and and after some coding an testing I found out ,that the movement just does not feel very responsively. I am moving my player with this code:
playerRigidbody.AddForce(Input.GetAxis("Horizontal") movementSpeed, 0, Input.GetAxis("Vertical") movementSpeed, ForceMode.Force);
I know there are different types of forcemodes, but they all do not realy feel good. It should be like a normal walking movment (if I press "D" the player should move instantly to his max. movement speed (but not faster) and if I stop pressing any key the player should stop instantly).
Comment
Answer by MaxGuernseyIII · Oct 25, 2017 at 02:54 PM
How about the following?
playerRigidbody.velocity = new Vector3(
Input.GetAxis("Horizontal") * movementSpeed,
0,
Input.GetAxis("Vertical") * movementSpeed);