人在火车上,火车在移动中。怎么实现人从车头走到车尾的功能。
我目前是这么实现的,继承CharacterMovementComponent 和 PathFollowingComponent,把PathFollowingComponent中的MovementComp->GetActorFeetLocation() 改成 MovementComp->UpdatedComponent->RelativeLocation,然后重载CharacterMovementComponent的MoveAlongFloor函数 通过 LineTraceSingleByChannel 获取位置。但是这么实现的问题在于AIcontroller的PathFollowingComponent是private_subobject,可能会有问题。所以有别的实现方法吗