Need help with calculating time required to pass a set distance.
There's a really annoying problem that I don't even know what to do about. So, I need the player to move in two dimentions by typing two numbers, one being the number of units to go horisontally and the other - vertically. Here's the process: 1. Numbers are entered. 2. The script for all that makes it so that the speed of the player is equal to a float, let's call it S, while also maintaining the direction. Everything listed above this point works. (I checked) Now for the problem: 3. I need to assign another float, let's call it T, to be the amount of seconds the player will move for. 4. Then T decreases with time, and the player stops once it reaches zero. So could somebody help me with the formula to assign T, so that once the player stops, they have passed the amount of units in each direction that is the same as the numbers entered? I'm pretty sure it's a lot simplier then the second step, but I just can't.
Your answer
Follow this Question
Related Questions
Math: How to rotate a wheel by drag&drop (Canvas, 2D)? 0 Answers
How can I launch a GameObject at a target if I am given everything except for its launch angle? 1 Answer
Rotating a game object to match the surface of a 2D Line 0 Answers
2d - Check if point is within bounds, rotation 1 Answer
Advanced placing position from the same angle of target position 0 Answers