How can i make a turret

So i want my turret to rotate with a delay, for example, when i move my mouse too quickly, the turret slowly turns towards the mouse. I did not find much posts with a simple solution. I also tried using CFrame.LookAt but it rotates the turret too fast + i can not limit the turret’s rotation.

using CFrame:Lerp() is what you need to ease the turret into its correct CFrame.

turret.CFrame = turret.CFrame:Lerp(CFrame.LookAt(turret.Position, mouse.Position), 0.2)

CFrame | Documentation - Roblox Creator Hub for more info

You can limit the rotational / positional bounds by using math.clamp.

2 Likes

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