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

Why is my missile flipping when I change the BodyGyro's cframe?

Asked by 7 years ago

Hi, i'm making a missile that uses a seperate tool that gets mouse.Hit.p to get the position, at the first the missile flys into the sky with a BodyVelocity and after that it's supposed to use BodyGyro to turn to the ground and hit the coordinates, instead it's just randomly flipping now.

local missile = game.Workspace.Missile
local particle = missile.Handle.ParticleEmitter
local up = missile.Thruster.BodyVelocity
up.Name = "Up"

local fired = false
script.Parent.ClickDetector.MouseClick:connect(function()

        if not fired then


            particle.Enabled = true -- Turn on engine

            up.MaxForce = Vector3.new(400000,500000,400000) -- Taking off.

            wait(3) -- Time to get into the air.

            print('Second stage.')      


            up.MaxForce = Vector3.new(400000,430000,400000) 

    missile.Thruster.BodyGyro.cframe =  
 CFrame.new(game.ServerStorage:WaitForChild("Coordinates").Value, missile.Eye.Position)

    end
end)

Answer this question