Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a variable be equal to the current position of a part?

I want the variable x to be equal to the current x position of part

part=script.Parent
x=part.Position

That gives me x,y and z but i just need the x How would i make it so x= the current x position of the part.

1 answer

✓ Accepted answer

Position has its own X, Y, and Z sub-properties. Therefore you can just write,

local x = script.Parent.Position.X

2 comments

0

well now i feel dum, ty

2

Also remember you aren't referencing the property, you're storing it. So whenever you make changes, it will only impact the variable itself, not the property of the object itself.

This discussion is preserved as it was. New answers, comments, and votes are closed.