Help with bodyGyro

Basically I wanna make a part rotate to mouse cursor, I tried something like

while true do
local MousePos = Mouse.p
local iceshardPos = iceshard.Position
local lookAtPos = Vector3.new(MousePos.X, iceshardPos.Y, MousePos.Z)
bodyGyro.CFrame = CFrame.new(iceshardPos, lookAtPos)
wait()
end

but it doesnt work, any tutorials on bodyGyro or feedback would help :pray:

1 Like

You get the mouse’s position with Mouse.Hit.p

1 Like

a nvm I figured it out lmao thank you doe