I have a mindless titan scripted for an aot game and I wanted to make it able to detect wheather a player is at its top right, top left, bottom right, bottom left so that animations made accordingly would play.
Image reference:
I have a mindless titan scripted for an aot game and I wanted to make it able to detect wheather a player is at its top right, top left, bottom right, bottom left so that animations made accordingly would play.
Image reference:
You could do titan.HumanoidRootPart.CFrame:ToObjectSpace(leviAckerman.CFrame)
which will return a CFrame in object space. After that it is quite simple to detect which quadrant the player is in using the X and Y coordinates, based on whether they are negative or not.
+X and +Y => TopRight
+X and-Y => BottomRight
-X and +Y => TopLeft
-X and -Y => BottomLeft
thanks worked perfectly
not enough characters
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.