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

How to take a position of an object and minus one of the axis?

So I've been working on a script for awhile but am stuck on this one bit, I want the block to be a little bit below the torso, but since

Im currently using Parts[i].CFrame = Parts[i].CFrame:lerp(game.Players.LocalPlayer.Character.Torso.CFrame-Vector3.new(0,-50,0), 0.) 

is the exact middle, how would I specifically minus an amount from the y or any value? EDIT: Got it working! I had just 0. and it needed to be 0.9

1 answer

✓ Accepted answer

Hey, so if you'd like to subtract 1 from the y coordinate, all we have to do is this,

local pos = game.Players.LocalPlayer.Torso.Position-Vector3.new(0,1,0)

or you could do this

local pos = Vector3.new(game.Players.LocalPlayer.Torso.Position.X,game.Players.LocalPlayer.Torso.Position.Y-1,game.Players.LocalPlayer.Torso.Position.Z)

Hoped this helped :)

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