Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

can someone help explain why this wont constantly rotate with CFrame.fromEulerAnglesXYZ?

Asked by 5 years ago

I want this part to follow the character and constantly spin, I thought this would make the brick always spin but it only rotates once leaving the brick on an angle still following the player.


function OnPlayerEntered(player) local a = Instance.new("Part", workspace) a.Anchored = true player.CharacterAdded:Connect(function(char) while wait() do a.CFrame = CFrame.new(char.UpperTorso.Position + Vector3.new(0,0,5)) * CFrame.fromEulerAnglesXYZ(0.1,0.1,0.1) end end) end game.Players.PlayerAdded:Connect(OnPlayerEntered)
0
the parent argument to Instance.new() is deprecated. And wait() should NOT be your condition in while loops. true should've the condition for infinite loops. User#19524 175 — 5y

Answer this question