Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make a bodyposition move something behind the player?

Asked by 7 years ago

I'm trying to make a ghost NPC companion that follows the person around. I am currently trying BodyPositions for this, instead of my original idea, welding. I want the position of the NPC to be slightly above, to the left, and behind the player, and it works, but only when I face a certain direction. I am absolutely terrible at math, so I've got no idea what I should actually try doing.

while on do wait()
    ghostBodyPos.Position = torso.Position +(torso.CFrame.lookVector * -1.7) + Vector3.new(-2,1,0)
end

ghostBodyPos is the BodyPosition, torso is the torso of the player.

Thanks in advance!

1 answer

Log in to vote
0
Answered by 7 years ago

you already have a system for the lookvector, so just use that

while on do wait() ghostBodyPos.Position = torso.Position +(torso.CFrame.lookVector * Vector3.new(-2,1,-1.7)) end

Ad

Answer this question