Hi, im trying to make a rocket launcher. I want the rockets of the rocket launcher to be affected by gravity, and so i also want the rockets to constantly point towards their own velocity when they are flying through the air, kinda like how an arrow flies.
I got a script here, and i'm not sure what's wrong with it.
tool = script.Parent
Handle = tool.Handle
launcher = tool.Launcher
tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
local rocket = game.ServerStorage.Missile:Clone()
rocket.CFrame = CFrame.new(launcher.CFrame.p, mouse.Hit.p)
rocket.Velocity = rocket.CFrame.lookVector * 100
rocket.Parent = workspace
while true do
rocket.Orientation = CFrame.new(rocket.Velocity).lookVector
wait()
end
end)
end)
This is the bit that doesn't work:
while true do
rocket.Orientation = CFrame.new(rocket.Velocity).lookVector
wait()
end
This bit doesn't do what it's supposed to, it makes all the rocket continuously point towards 0, 0, -1. Can someone figure out why this is happening?

1 comment
But this script makes the rocket go in a straight line, at that's not what i want. I want the rockets to fly like an arrow would.