I have been using that and it didn’t work for what I need. I’ll show you my code.
while true do
local posx = tonumber(game.Workspace.Part.Position.X)
local posy = tonumber(game.Workspace.Part.Position.Y)
local posz = tonumber(game.Workspace.Part.Position.Z)
local posxround = math.round(posx)
local posyround = math.round(posy)
local poszround = math.round(posz)
local vector = Vector3.new(posxround,posyround,poszround)
script.Parent.Position = vector
wait(.1)
end
The script gets the position of your object just fine. I made two small modifications to demonstrate:
-- Open output to see proof!
while true do
local posx = tonumber(game.Workspace.Part.Position.X)
local posy = tonumber(game.Workspace.Part.Position.Y)
local posz = tonumber(game.Workspace.Part.Position.Z)
local posxround = math.round(posx)
local posyround = math.round(posy)
local poszround = math.round(posz)
local vector = Vector3.new(posxround,posyround,poszround)
script.Parent.Position = vector
print(vector) -- Position (works)
wait(1) -- Longer "wait"
end