Rotation Part Jittering When Mouse is at Center

What do you want to achieve?
I want the rotating part to rotate smoothly and face where the player is looking or pointing their mouse, both on PC and mobile, including in first-person view.

What is the issue?
When the mouse is in the center of the screen — especially in first person — the part starts jittering or fails to rotate smoothly. It struggles to face the direction accurately and seems to get “stuck” or flicker.

Here’s a snippet of the code I’m using for rotation:

Video:

External Media

I believe this is because the mouse ray is hitting the turret, you need to filter out the turret. Try using a raycast instead and use a raycast filter.

1 Like