Why is CFrame.lookAt() inconsistent

Hi, I’ve found that CFrame.lookAt()'s functionality seems to be very inconsistent within remote Events, and only works if you add a task.wait() or other form of delay. I want to understand why this is the case and if there is an alternative to using a delay.

The following video is a demonstration of what happens without task.wait()

This is what happens with task.wait()

Code for the first video (without task.wait())
image

Code for the second video (with task.wait())
image

Alternatively, if there is a better way to get orientation from two vector3’s, that would also be appreciated.

1 Like

Hmm this is an odd one. Here’s an idea, send the mouse.p through the remote event rather than sending the mouse object (which is what I assume you’re sending through rn)

2 Likes

I don’t know why this is happening but you try using CFrame.new for that too Pointer.CFrame = CFrame.new(Pointer.Position, mousePos) Oh, and me personally I would send the mousePos directly as Vector3 because handling it on the client is less laggier for everyone rather then indexing it on the server

1 Like

Thanks for pointing that out, I have no clue why I was sending it as a CFrame lol. Unfortunately the issue still occurs without task.wait().

1 Like

As for using CFrame.new(), I’ve tried that but it didnt change anything (still required task.wait()).

CFrame.new(position, position) should be operationally the same as lookAt no?

1 Like

I am apparently a clown. I was making a position change elsewhere

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.