How do I make something rotate with BodyGyro the same rotation as a player

How do I make something that rotates with BodyGyro that rotates the same with a player?

Simply get the players look vector and apply that as a cframe of the gyro.

So you get the cframe of the player’s head

local look = game.Players.LocalPlayer.Character.Head.LookVector

Then you alpply that to the gyro

local gyro = --gyro
gyro.CFrame = look

and then put in in the function

look.Changed:Connect(function()
     local gyro = --gyro
    gyro.CFrame = look
end)

Finished product:

local look = game.Players.LocalPlayer.Character.Head.LookVector
local gyro = --gyro

look.Changed:Connect(function()
   gyro.CFrame = CFrame.new(look)
end)
2 Likes

Can you use LookVector in a Server Script?

Yes, you can use look vector in a server script, it’s not client based, so you can use it anywhere(if that specific object has a cframe value)

1 Like