Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Rocket Propulsion Script help?

I have a mesh Jet and i put a rocket propulsion script inside of it and i set a target brick about 50 yards away so that the Jet would go to it but nope, the jet just jumps a little bit off the ground every 2 seconds getting a little closer but that's not what i want. I want it to fly towards it, not inch towards it. Here is my script, please help!


I want the Jet to fly towards the target


local rp=Instance.new("RocketPropulsion")
rp.Parent=script.Parent
rp.MaxSpeed=10000
rp.MaxTorque=Vector3.new(10000000,10000000,10000000)
rp.Target=workspace.Target
rp:fire()

2 comments

0

An answer would be great! :D

0

You should increase the MaxThrust and ThrustP properties

1 answer

✓ Accepted answer

It's moving ridiculously slow because the force of gravity (196.2 studs/sec) is probably much stronger than the pushing force. Considering putting in a bodyforce to counter its gravity, or otherwise get it to lift off the ground.

The exact formula for 0 gravity is this:

bodyforce.force = Vector3.new(0, part.Size.X * part.Size.Y * part.Size.Z * 196.2, 0)

And the finished script should look something like this:

local rp=Instance.new("RocketPropulsion")
rp.Parent=script.Parent
rp.MaxSpeed=10000
rp.MaxTorque=Vector3.new(10000000,10000000,10000000)
rp.Target=workspace.Target
local bf = Instance.new('BodyForce', script.Parent)
bf.force = Vector3.new(0, part.Size.X * part.Size.Y * part.Size.Z * 196.2, 0)
rp:fire()

2 comments

0

Not working correctly

0

Because you're A. allowing it to move up on the Y axis because the MaxTorque has 10000000 Y, and B. You're not setting the P property to something higher (controls how aggressively the RP tries to reach its target)

This discussion is preserved as it was. New answers, comments, and votes are closed.