What I'm wondering is how I remove 1 from 15 on a Position like Vector3.new(15, 16, 17)?
Help please.
What I'm wondering is how I remove 1 from 15 on a Position like Vector3.new(15, 16, 17)?
Help please.
You can subtract Vectors,
local newPos = Vector3.new(15, 16, 17) - Vector3.new(1, 0, 0)
You can also add a negative number to subtract
local newPos = Vector3.new(15, 16, 17) + Vector3.new(-1, 0, 0)
This is not that hard to do. First, lets get the position of the Part:
game.Workspace.Part.Position
Now, we have the position of the part, so we want to get the position to equal something, and in this case, we want it to equal the same thing, by -1 on the X axis, so we would get the Position again and subtract it by a Vector3(1,0,0)
game.Workspace.Part.Position = game.Workspace.Part.Position - Vector3(1,0,0)
See, this is quite the easy task, it is subracting the Position by the numbers we gave.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
That's the X axis?
Oh wait, I meant X