✓ Accepted answer
The character does not have a position because it is a model. However, the descendants of the character has positions. For example, HumanoidRootPart and Torso.
To call the positions, just simply write whatever you're trying to get the position of.
char.HumanoidRootPart.Position
However, there is also another problem that occurs. The character might not be loaded when the player joins the game. So therefore you cannot just simply write local char = player.Character. You could wait for the character to be added by using the player.CharacterAdded event. To wait for the character, just simply write player.CharacterAdded:Wait() between line 1 and line 2. Or, if you wanted the character to explode every time they load in (both joining and respawning), write something like this:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
end)
end)
Also, the descendants of the character may not be loaded when the character loads in. So just add another wait to counter that. For example, local hrp = character:WaitForChild("HumanoidRootPart")
I hope this helps!
1 comment
thank you this actually explains it better for me to understand as well