Jump to content
  • 0

How to make npc move direction?


hadie

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  86
  • Reputation:   1
  • Joined:  03/11/12
  • Last Seen:  

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

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  07/10/24
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  63
  • Topics Per Day:  0.02
  • Content Count:  1016
  • Reputation:   191
  • Joined:  11/27/14
  • Last Seen:  

You can use "npcwalkto" . You can see it on your server files script_commands to properly guide you how to use all npc script syntax

Link to comment
Share on other sites

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.

×
×
  • Create New...