AI Helicopter Movement Malfunctioning & Bugging

try instead of using weld constraints and CFraming the one thing use Motor6ds. If you have Moon Animator you can easy weld (to join them in place) then instead of changing their CFrame, change the M6d C0.

Don’t have moon animator, I’m not trying to make a bigger problem out of this but it has to be fixable by just scripting it. I don’t feel like using an animator to rig / weld it. I don’t see a need.

Alright, So, Imma try to make a script to do what Moon Animator does

local Motor = Instance.new("Motor6D")
local Primary = script.Parent.Parent.PrimaryPart

Motor.Parent = script.Parent
Motor.Part0 = Primary
Motor.Part1 = script.Parent
Motor.C0 = script.Parent.CFrame * Primary.CFrame:Inverse()

That makes a motor and SHOULD position it right, paste this in your part then go into your game, copy the model, leave and paste it in, Its basic rigging, but its exactly how you fix your problem, (also disable your movement scripts)

Then all you need to do is

while true do
	script.Parent.MotorName.C0 = script.Parent.MotorName.C0 * CFrame.fromEulerAnglesXYZ(0,1,0)
	wait()
end
1 Like

Thing is, the roters don’t have a primary part. It’s just a part that sticks to the heli.

Let me try it tho, I’m very unsure if it works. I’ll get back to you later.

I tried to make it the model’s primary part so you can weld it to the center

Sorry but where do I exactly paste this?

in a script inside the part, Im about 90% sure it works, also disable your spinny script cuz movement breaks m6ds

Tried, didn’t work.

ANy other option…?

Could we see a place file? Would you feel comfortable sharing that with the devforum? At least, for me, I would need it to be able to assist.

For the rotation of the helicopter blades, you can just use a hingcontraint, and set it to Motor. You do not need a script. HingeConstraint | Roblox Creator Documentation

I don’t feel comfortable. If you have discord I may add you and we can discuss there.

From what I can gather, this line is resulting in the teleport into the ground:

From there, the tween is playing. You may have to change the way the helicopter blades rotate, through HingConstraints as I mentioned. The reason they stop rotating was:

You weld the blades in place, breaking the tween (keep in mind, this is just a hypothesis. I cannot test)

Not sure. It only executes that once there’s no other destinations left.

After it reaches it end point, it’ll get tped back.

This has nothing to do with the start.

Okay, I didn’t realize. You can add a simple line in at the end, once the tween stops:

HeliModel.PrimaryPart.CFrame = FinalPart.CFrame -- with HeliModel being your helicopter model, and FinalPart being the final destination part.

Wait I didn’t realize that’s what’s breaking it!

LOL thanks for saying. I may find my solution from there? Not sure if I am able to initalize a script after welding.

All you have to do is check if the parts you want to weld are the right parts.

function WeldAIHelicopter()
	for i = 1, #AIHelicopter:GetChildren() do
		if AIHelicopter:GetChildren()[i] ~= AIHelicopter.PrimaryPart and AIHelicopter:GetChildren()[i] ~= AIHelicopter.RotorTop and AIHelicopter:GetChildren()[i] ~= AIHelicopter.RotorBack then -- Do a simple check
			local Weld = Instance.new("WeldConstraint")
			Weld.Part0 = AIHelicopter:GetChildren()[i]
			Weld.Part1 = AIHelicopter.PrimaryPart
			Weld.Parent = AIHelicopter.PrimaryPart

			AIHelicopter:GetChildren()[i].Anchored = false
		end
	end
end

Trying this tomorrow.

Tahnk you so much for helping me this far already.

1 Like

Breaks it.
Sorry lol

Any other fix? There should be one.

I really can’t help you past that. The best I could suggest would be to keep changing, testing, and generally fixing the script.

1 Like