An error occurred when using the program to call NPC's "MoveTowards" ability

Bai

New member
I want to achieve that I interact with NPCs, and first move them to a fixed position before playing the animation. I use "Interactable," and call the following script to make the NPC move to the specified position using the MoveTowards ability, but the movement action has a problem and strange rotation occurs. Is there any good solution for this?
屏幕截图 2024-12-10 205235.png屏幕截图 2024-12-10 205335.png
 
I made a mistake and changed his position in the dialogue system, which resulted in him rotating incorrectly.
 
If I want to create this kind of interactive animation, is there any other quick way to change the AI's position besides using this command?
 
Glad you got the core piece solved. Using the MoveTowards ability to move to the destination is the correct route. Depending on your use case you may not need it within an interactable target but the actual code looks good.
 
Back
Top