Article directory
1. Achieve goals
Realize the automatic movement effect of the character according to the spline Spline , the GIF animation is as follows.
2. Implementation process
2.1 Implementation ideas
(1) To get the position of the point on the spline at a certain moment, GetLocationAtTime
just use the function directly.
(2) Update the input vector of Character in real time.
差值
The input value of the calculated vector by the position of the point on the spline and the character's real-time world position .
Remember not to set the position of the Character directly , as this will only allow the character model to move independently, and the skeleton body will not change, that is, there will be no effect of running and moving.