How can I check the position of a part

Hi I was wondering how can I check if a parts position (for example 0,0,0)

1 Like

Just do part.Position, you mean something else right?

Use part.Position, it returns a Vector3 value with the coordinates.

But, if you want to get a CFrame instead, use part.CFrame.

I mean like using a if statement

use

if part.Position == Vector3.new(0, 0, 0) then -- change the 0 to wherever you want
--whatever you want to do
end
2 Likes

Here’s an example:

local part = workspace.Part
while task.wait() do
	if part.Position == Vector3.new(0, 20, 5) then
		--your code lol
	end
end
local Part = game.Workspace.part

print(Part.Position)

This will give you the The coordianted of the part you can edit it further like the Y axis or X axis

firstly if the part is a child of workspace you can retrieve the position by doing:

local Part = workspace.Part
local PartPosition = Part.Position

Use the PartPosition in your code.