Vector3 Dot Product: Calculating NPC Field of View (Roblox Studio)

Описание к видео Vector3 Dot Product: Calculating NPC Field of View (Roblox Studio)

Learn one of the main applications of using a vector math operation: the dot product. Also known as a scalar product, the dot product of two vectors represents the amount of distance the two vectors travel together. In the case of unit vectors, we can figure out how similar two vector's directions are by looking at their dot product, which should range anywhere from -1 (total opposite) to 0 (perpendicular) to 1 (total parallel).

In the case of NPC "Field of View", we check to see if a given character's direction from the NPC is similar enough to the NPC's LookVector. If it is, we can conclude that the given character's position is in the "Field of View" of the NPC. This is one of the basic principles of making Artificial Intelligence (AI) characters in game development.

Join my Discord Community!   / discord  

Have video suggestions or have some scripting-related questions? Contact us by:
- Joining our Developer Community:   / discord  
- Leaving a comment
- DMing me on Twitter @okeanskiy_dev
(  / okeanskiy_dev  )
- My Roblox Account Username - okeanskiy

Show support with a like and subscribe/notify yourself for more videos!

#Roblox #RobloxDev #RobloxTutorial #okeanskiy #april1st

Комментарии

Информация по комментариям в разработке