Hello, I’m developing a prototype for my 3D topdown game in C#. I have a capsule as my player character; he can move (although twice as fast when moving diagonally), rotates according to what direction he is moving, and has a camera following him without rotating with him.
Now, I’m trying to get him to ‘dash’–to move a few metres in the direction he’s facing in half a second when the ‘Z’ key is pressed.
So far, I made two floats: - public float dashDistance & public float dashSpeed
Where do I go from here? (I’m very new to programming)
Please note: you should Lerp from your initial position, rather than currentPosition, in your loop. Otherwise as you get closer to your final position, you’ll slow to a crawl and unless your framerate dips below 1FPS, you’ll never actually reach your target destination.