I’m experiencing a problem where my character’s humanoidRootPart isn’t connected to the rest of the character’s body parts like intended, as shown in the video below.
This only happened after I changed the wait() from my respawn script to runService.Heartbeat:Wait() so I guess that caused the problem.
Has anyone else ever experienced this problem before? Should I just use wait() eventhough it is considered code smell?
1 Like
This has never happened to me but if you find it useful this is the official roblox guide on how to use heartbeat.
https://developer.roblox.com/en-us/api-reference/event/RunService/Heartbeat
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
local HRP = char:WaitForChild("HumanoidRootPart")
runService.Heartbeat:Wait()
HRP.Position = Vector3.new(0, 280, 0)
end)
end)
This is the respawn script I’m using. It’s on the server.
Move its CFrame
instead of Position
, otherwise you’ll break the character joints.
HRP.CFrame = CFrame.new(0, 200, 0)
2 Likes
Thanks, this works. Btw, you should put a vector3 as an argument in the CFrame.new() as just putting those numbers won’t run.
Though, this still doesn’t explain why HRP.Position always worked for me until I switched to runService.Heartbeat:Wait(). But I can live with using CFrame. Thanks a lot 
1 Like
No problem!
Glad if that worked.
1 Like