#Vector3 Dot?
7 messages · Page 1 of 1 (latest)
Vector3 dot is mainly used for checking if two directions (Vector3s) are the same. One of the biggest uses for this is checking to see if a player is looking at an object.
The chip returns the dot product of both inputed Vector3s, so if both inputed Vector3s are normalized (which you can do with the Vector3 normalize chip) the closer the output will be to 1.
https://docs.unity3d.com/ScriptReference/Vector3.Dot.html here’s a funni link too
Ok i wanna ask something. i want it so if i point a sword in a direction for a sec and then you put it somewhere else it will do a slash and i know for the points at the directions part i need to use vector dot but how would i make it so if the sword is point one direction it play and event?
Nevermind.
Event Reciever (Update 30Hz)
Get Forward Vector of the Sword
Vector Dot the Forward Vector and the checking Direction, if the Vector Dot is Greater Than the input amount, active a Bool for the first part of the Event. Then check for when the Greater Than is False via a Not chip (Cryptic this is a small system, please do not start bombarding the If Value chip for this person's sake!), if the Not is True, send the 2nd Event for the Slash.