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

How Do I Get an Object to Move Forward Where it is Rotated?

Asked by 8 years ago

Hello, I am sorry if it seems as though I have put no effort in this, but I just can't find anything. How would I get something to move forward in the direction it is pointing? Thanks for reading, ~yoman1776

1 answer

Log in to vote
1
Answered by 8 years ago

x = script.Parent -- Change x to the object you're trying to move. bv = Instance.new("BodyVelocity") bv.maxForce = Vector3.new(math.huge, math.huge, math.huge) bv.Velocity = x.CFrame.lookVector*100 -- Change 100 to however fast you want it to go. bv.Parent = x

Using CFrame.lookVector grabs the direction the part's front surface is facing.

0
Thanks! This is exactly what I needed! yoman1776 85 — 8y
Ad

Answer this question