I’m self teaching myself programming and Unity and sometimes it’s a real detriment not to have a lecturer to ask, but I’m trying to work out a moving target’s new position over time (2D in my case). For simplicity, let’s say the time I want is 1 second.
So a target’s new position will be its present position, plus its heading(rigidbody2D.velocity) by its speed (rigidbody2D.velocity.magnitude) by the time (1 second). That’s just based on my secondary school Physics knowledge. Simple enough.
So, on paper, I’d draw a triangle, get the hypotaneuse length (velocity.sqrmagnitude) and make that equal to length x.x and length y.y (I mean “squared”, how do I type that?..). Then I could work it out, on paper at least.
Coding this process into c# seems a bit unwieldy to me, and I’m thinking Unity must have a simpler function that I’m just unaware of for doing this exact job. Calculating a new position after time of (x).
Is there? Or was I on the right track all along?
Thanks folks
Kevin