Make CFrame.lookAt() more smooth?

I’ve been trying to look for a way to make the CFrame.lookAt() function smoother, since it’s too rigid, but I haven’t found a reliable solution so far. I’ve tried using Lerp() however I haven’t been able to get it working with server scripts. All help is appreciated!

while task.wait() do
	script.Parent.Base.CFrame = CFrame.lookAt(script.Parent.Base.Position, script.Parent.Target.Value.Position, Vector3.new(0, 1, 0))
end
3 Likes

On the server its always going to be a bit jittery, but your best choice I’d say is tweening

2 Likes

Another option would be to use runservice.Heartbeat, although it might still jitter. Your best bet is to definitely use tweeting though.

1 Like

Mover Constraints | Roblox Creator Documentation I use these in for example my FPS character controllers to turn smoothly towards where you look… but for your usecase you can make it make a part face another part in a smooth way.

1 Like

Constraints aren’t for all use cases, as they are physics-based. However, depending on what OP is trying to achieve, they may or may not work.

1 Like

Way more performance friendly and achieves basically the same as tweening with customizability plus it’s faster… got nothing to lose with using them. I couldn’t imagine creating tweens every frame (trust me I know how bad that runs on the server), you’d have to delay those and risk precision loss.

1 Like

use tweenservice or change it every frame witth heartbeat or renderstepped

1 Like

True but again, constraints are physics-based. So it depends on what the OP is trying to achieve (yes, there are collision groups but then again they get complicated if you have too many things).

1 Like