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.

5 comments

0

you could check if the dot product of the two vectors is equivalent to 0

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

0

and there really isn't any case when you shouldn't display your code

0

and if statment should do?

0

ill go for the dot product