generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Why is the position not like i want it to be?

Previous Thread :: Next Thread 
davie10863 is not online. davie10863
Joined: 13 May 2011
Total Posts: 33
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image