# Rocket friend

• It uses a BodyForce and BodyGyro. I played around a lot with some different formulas for how much force to use and settled with this, where the force is proportional to the square of the distance. Its target is a moving point that circles above your head. The force is in the direction of the target plus the velocity of the head minus the velocity of the rocket. The gyro has an upward tilt so it doesn't look completely gravity defying even though it is.

``````local head=script.Parent:WaitForChild("Head")
local rocket=Instance.new("Part")
rocket.Size=Vector3.new(1,2,1)
rocket.CanCollide=false
local mesh=Instance.new("SpecialMesh",rocket)
mesh.MeshId="rbxassetid://31601976"
mesh.TextureId="rbxassetid://31601599"
mesh.Scale=Vector3.new(.75,1,.75)
mesh.Offset=Vector3.new(0,-1,0)
local fire=Instance.new("Fire",rocket)
fire.Color=Color3.new(.5,.5,.5)
fire.SecondaryColor=Color3.new()
fire.Size=2
fire.Heat=25
local gyro=Instance.new("BodyGyro",rocket)
gyro.MaxTorque=Vector3.new(math.huge,math.huge,math.huge)
local force=Instance.new("BodyForce",rocket)
local gravity=Vector3.new(0,rocket:GetMass()*196.2,0)
local p1=rocket.Position
gyro.CFrame=CFrame.new(p1,p2+Vector3.new(0,10,0))*CFrame.Angles(math.pi/2,0,0)
force.Force=(p2-p1).unit*((p2-p1).magnitude^2/10+10)+gravity
wait()
end
``````

(in StarterCharacterScripts)

• Oh, that's neat!

• @1waffle1 Neat.

Could a pr0 coder like chursalf make it target onto, fly into, and vaporize anything coming near you?? >:3

• @Goulstem That would be cool.

I think I would like to see what the rocket sees via camera manipulation.

Idk. Maybe even be able to control the rocket when you're viewing what it would see.

• @OldPalHappy Oooh like a controllable drone? I dig.

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.