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: how do i make a part go forward

Previous Thread :: Next Thread 
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 May 2015 12:43 AM
based on the lookvector
Report Abuse
SavageMunkey is not online. SavageMunkey
Joined: 10 Jun 2012
Total Posts: 200
26 May 2015 12:47 AM
try part.BodyVelocity.velocity = part.CFrame.lookVector*100
Report Abuse
SavageMunkey is not online. SavageMunkey
Joined: 10 Jun 2012
Total Posts: 200
26 May 2015 12:51 AM
e.g.
e = Instance.new('Part',workspace)
e.Size = Vector3.new(.5,.5,4)
while true do
e.Velocity = e.CFrame.lookVector *10
wait(0.1)
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 May 2015 12:53 AM
Do you want to just position it forward or move it forward like, with velocity?
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 May 2015 12:57 AM
?

um for forward based on the lookvector, and u can change the forwardness by moving the mouse
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 May 2015 12:58 AM
Yes I know, but do you want it to like, be teleported forward or 'moved' forward?
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
26 May 2015 01:12 AM
Part.CFrame = Part.CFrame.lookVector * 10 -- 10 studs forward
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 May 2015 01:13 AM
Not quite, no.
That would actually make it position at 10 studs from the center of the map (0, 0, 0). You'd wanna do:
Part.CFrame = Part.CFrame + Part.CFrame.lookVector * 10 -- 10 studs forward
Or even better:
Part.CFrame = Part.CFrame * CFrame.new(0, 0, -10)
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 May 2015 01:14 AM
local person;
local Part = script.Parent.Part;

script.Parent.VehicleSeat.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
person = hit.Parent
end
end)


repeat wait() until person ~= nil
mouse = game.Players:GetPlayerFromCharacter(person):GetMouse();
while wait() do
Part.CFrame = CFrame.new(Part.Position, mouse.Hit.p);
Part.Velocity = Part.CFrame.lookVector * 10;
end
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