Simple code not printing part position

I have changed the player into a part. I’m trying to disable player movement and simply print out the position of the player.
The movement does get disabled but the part position doesn’t get printed. I’ve looked all of the dev forum but nothing helped. I’m really sorry if this is too naive; I just started scripting.
Any help is appreciated.
The following script is in StarterCharacterScript and is a local script:

local LocalPlayer = game:GetService("Players").LocalPlayer

local Controls = require(LocalPlayer.PlayerScripts.PlayerModule):GetControls()

Controls:Disable()

local Character = game.Players.LocalPlayer:WaitForChild("Character"):WaitForChild("HumanoidRootPart")

print(Character.Position)

1 Like

Just do this:

local character = script.Parent:WaitForChild("HumanoidRootPart")

Since the Script would be parented to the Character, you dont need to check the Player for the Character, just script.Parent.

And also, Character is a Property, not an Instance, so WaitForChild will not work on it.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.