Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a CFrame look at a coordinate(not the traditional way)?

Asked by 6 years ago

So I know I could just do CFrame.new(origin, lookat), but I have a problem with that method. Imagine that the coordinate that's supposed to be looked at can rotate so the circle that it makes stands perpendicular on the ground. If I would use this method, the CFrame would always be formed so that the UpVector in it looks to the sky, so this has the effect that the CFrame is rotated 180 degrees in opposite halfs of that circle. I need my CFrame to always have the same rotation around that axis, so the UpVector is facing the ground at the "back half" of the circle.

If I can't do that, I would need something that checks if it's at the other half of the circle, but I have very little information to check that, that one CFrame is pretty much the only thing I have...

0
Learn trigonometry. Fragmentation123 226 — 6y

Answer this question