Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make a cframe look away from something?

so lets say i have a part that i want to look away from a point via cframe. Thing is, inverting the lookat vector3 values doesn't work. it just still looks at the point. even if the values are inverted.

2 answers

It's easy. Use CFrame.new and invert the second parameter.

script.Parent.CFrame = CFrame.new(script.Parent.Position, -workspace.Part2.Position)

Change workspace.Part2 to your part. (Note that the script is inside a part.)

1 comment

0

Its just that that didn't work anyways :/ i tried inverting it but it still wouldn't work. i tried a different idea for what i was trying to accomplish, and it worked. thanks for the answer though

try this:

script.Parent.CFrame = CFrame.new(script.Parent.Position, workspace.Part2.Position * Vector3.new(1,1,-1))

This discussion is preserved as it was. New answers, comments, and votes are closed.