UE realizes the effect of moving characters along splines

1. Achieve goals

Realize the automatic movement effect of the character according to the spline Spline , the GIF animation is as follows.

insert image description here

2. Implementation process

2.1 Implementation ideas

(1) To get the position of the point on the spline at a certain moment, GetLocationAtTimejust use the function directly.

insert image description here

(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.

Je suppose que tu aimes

Origine blog.csdn.net/weixin_45782925/article/details/128807972
conseillé
Classement