|
| 01 Jul 2016 03:58 PM |
I'm trying to make a part follow a player but be position in front of the player's torso but it's not in front of the player's torso. It goes to some other position around the player. Here is the script:
player = Game.Players.LocalPlayer player1 = player.Character
part = Instance.new("Part",Workspace) part.Anchored = false part.CanCollide = false part.Rotation = player1.Torso.Rotation part.Position = player1.Torso.Position rp = Instance.new("RocketPropulsion",part) rp.CartoonFactor = 0 rp.ThrustD = 3 rp.ThrustP = 5 rp:Fire() bg = Instance.new("BodyGyro",part) while wait(.1) do bg.CFrame = part.CFrame rp.TargetOffset = player1.Torso.Position +Vector3.new(0,0,10) -- Problem here part.Rotation = player1.Torso.Rotation end
I marked where the problem is, the purpose it to make it positioned in front of the player's torso but when i turn the player around it goes behind the player and then other positions. Help me fix this. Thank you
|
|
|
| Report Abuse |
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 01 Jul 2016 04:00 PM |
| rp.TargetOffset = player1.Torso.Position + (player1.Torso.CFrame.lookVector * 10) |
|
|
| Report Abuse |
|