Basically, I have a script that makes a part rotate towards another part but I only want the part to rotate if the other part is in front of it...
I shouldn't need to put my code here since all I'm doing is simple CFrame manipulation.
Basically, I have a script that makes a part rotate towards another part but I only want the part to rotate if the other part is in front of it...
I shouldn't need to put my code here since all I'm doing is simple CFrame manipulation.
This discussion is preserved as it was. New answers, comments, and votes are closed.
5 comments
you could check if the dot product of the two vectors is equivalent to 0
the two vectors being the lookvector of one of the parts and the unit vector of the difference of the positions of the two parts
and there really isn't any case when you shouldn't display your code
and if statment should do?
ill go for the dot product