I wanted the player to rotate when it spawns by scripting,rather than just rotating spawn location. but Changing HumanoidRootPart (PrimaryPart)'s CFrame only worked few secs later the character spawned. Even with WaitForChild function,it didnt work but not occured error. Are there any good ways to make it rotate when spawned,but not using wait() call?
local Players = game:GetService("Players") local spawnlocation = workspace.SpawnLocation game.Players.PlayerAdded:Connect(function (plr) plr.CharacterAdded:Connect(function () print(plr.Name) local rootpart = plr.Character:WaitForChild("HumanoidRootPart") rootpart.CFrame = spawnlocation.CFrame*CFrame.new(0,1,0,math.rad(10),math.rad(20),math.rad(30),1) -- this one doesnt work wait(3) rootpart.CFrame = spawnlocation.CFrame*CFrame.new(0,1,0,math.rad(10),math.rad(20),math.rad(30),1) -- this one works end) end)