Original Post
Hi, i have coding a path for my unit to move over a terrain made up of triangles. The path is 2D and a single path is made up of an arc, then a line then another arc. The 2D path will be used to locate the unit''s position in the horizontal plane and the height of the unit''s position will be obtained from the terrain.
I need to move the unit to an end point and reach the end point at a stated speed and heading. The slope of the terrain has to be accounted for, plus the maximum speeds and maximum acceleration the unit can have. I''m okay with reaching the correct heading but i''m not sure how to reach the end point at the correct speed.
I''m thinking of checking the unit''s speed every frame and increase it if it''s still not max and as the unit reaches a certain distance away from the end point, it will start to decelerate. However, i think there is a chance that the unit will not be able to decelerate in time due to variations in the terrain and due to the fact that it shouldn''t have accelerated to the max speed in the first place. So, any ideas how to make the unit smart enough to reach the end point at the correct speed?