How do I print a parts Orientation and Position

Currently trying to make something that tracks a part’s location, can’t really seem to have it to print the position value.

So far I’ve tried doing:
``
local Part = script.Parent
local PartPos = Part.Position

print(PartPos)
``
Not really sure why this simple line doesn’t work. I’m assuming I’m missing something, or the position isn’t recognized as a simple value.

Vector3 does not automatically convert to a string, you need tostring(PartPos)

The Position of a Part is a Vector3 value, and can’t really come out as a string. If you are simply trying to print it, try this:

local Part = script.Parent
local PartPos = Part.Position

print(PartPos.X,PartPos.Y,PartPos.Z)

Anything embedded in a print function is automatically ran through the tostring function. Surprisingly, Vector3s cannot become strings unless done manually.

Does it produce an error? This should work.

This works normally, but since I’m inserting a part within the StarterCharacter it for some reason doesnt. I’ve tried adding a ‘wait(1)’ to insure that it wasn’t the script running before the player spawns.

This should work if the script is parented to the part in starterCharacterScripts.

local part = script.Parent

local partPos = part.Position
local partOrientation = part.Orientation

print("Position:", partPos.X, partPos.Y, partPos.Z)
print("Orientation:", partOrientation.X, partOrientation.Y, partOrientation.Z)
1 Like

The character is a model, not a part.