How can I reverse the direction of a parts look direction

Honestly someone’s probably told me how to do this before, but I just forgot and I don’t know what to do. I’ve tried -Goal, I’ve tried Goal, Position with a BodyGyro, I don’t really know what to do here.

		Root.CFrame = -CFrame.new(Root.Position, Goal)

To reverse the direction that a part is looking, you can try using the - operator to negate the direction vector of the part’s CFrame . This will essentially flip the direction that the part is facing.

For example, you can use the following code to reverse the direction that a part called Root is looking:

Root.CFrame = -Root.CFrame

This will negate the direction vector of Root 's CFrame , causing the part to face in the opposite direction.

Alternatively, you can also use the .lookVector property of the CFrame to directly negate the direction vector without negating the position vector. This can be done using the following code:

Root.CFrame = CFrame.new(Root.Position, Root.Position - Root.CFrame.lookVector)

This will preserve the position of the part, but reverse the direction that it is looking.

I hope this helps! Let me know if you have any other questions.

2 Likes

Rather than bothering with CFrames. Cant you just add or subtract 180 degrees from the parts Orientation? This should work, alter to suit which axis you want to flip on.

local part = script.Parent
Part.Orientation = Part.Orientation + Vector3.new(180, 0, 0)

Try this:

Root.CFrame *= CFrame.Angles(0,math.rad(180),0)

You can, but I’m willing to bet that the orientation will not be right most of the time. Orientation can be messy and restricted and CFrames are just better to use and they’re more reliable.

ReverseDirection = -Root.CFrame.LookVector

ReverseCFrame = CFrame.lookAt(Root.CFrame.Position, (Root.CFrame.Position + ReverseDirection ))