Jump to content
  • 0

How to make npc move direction?


Question

Posted

How to make npc move direction when we touch the npc?

Like this

Before touch normal after touch the direction will follow where you are

Image01.jpg

Image02.jpg

2 answers to this question

Recommended Posts

  • 0
Posted

You can try my method, you have to calculate the new direction: Once you determine that the NPC has an effect on the player, you can calculate the direction that the NPC needs to change direction to avoid the next collision. This calculation may include:
* Calculate the direction vector from the NPC's position to the player's position.
*Adjust NPC navigation based on this vector, for example using the lerp (linear interpolation) method to make navigation smoother.
You can also go to Google to find out how to do it suitable for your game

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...