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

Rocket Propulsion Script help?

Asked by 8 years ago

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()

0
An answer would be great! :D QuantumScripter 48 — 8y
0
You should increase the MaxThrust and ThrustP properties aquathorn321 858 — 8y

1 answer

Log in to vote
3
Answered by
drew1017 330 Moderation Voter
8 years ago

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()
0
Not working correctly QuantumScripter 48 — 8y
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) drew1017 330 — 8y
Ad

Answer this question