Hi, I need help with getting the first 3 digits of the postion

I’m trying to get the first three digits of x/y/z.
I’m trying to tween a part to a another parts position by storing the the goal of the parts position in a variable
image
I need the first three digits of each position since if not it will reset to the world postion.


image
Thanks!

CFrame.Position gives you the Vector3 value of the position

You can try this:

local position = part.Position

local x = math.floor(position.X)
local y = math.floor(position.Y)
local z = math.floor(position.Z)

oh nice, didn’t knew that function exits thanks.

That isn’t going to help fix anything. The reason things won’t work is because of this line:

Position = Vector3.new(partpos)

The goal Position will always be (0,0,0) because you are initializing a Vector3 with a CFrame which would always give you (0,0,0).
I think you want:

Position = partpos.Position
1 Like

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