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
1 | local rp = Instance.new( "RocketPropulsion" ) |
2 | rp.Parent = script.Parent |
3 | rp.MaxSpeed = 10000 |
4 | rp.MaxTorque = Vector 3. new( 10000000 , 10000000 , 10000000 ) |
5 | rp.Target = workspace.Target |
6 | rp:fire() |
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:
1 | bodyforce.force = Vector 3. new( 0 , part.Size.X * part.Size.Y * part.Size.Z * 196.2 , 0 ) |
And the finished script should look something like this:
1 | local rp = Instance.new( "RocketPropulsion" ) |
2 | rp.Parent = script.Parent |
3 | rp.MaxSpeed = 10000 |
4 | rp.MaxTorque = Vector 3. new( 10000000 , 10000000 , 10000000 ) |
5 | rp.Target = workspace.Target |
6 | local bf = Instance.new( 'BodyForce' , script.Parent) |
7 | bf.force = Vector 3. new( 0 , part.Size.X * part.Size.Y * part.Size.Z * 196.2 , 0 ) |
8 | rp:fire() |