i have this helicopter controller and im currently trying to implement animatable rotor blades. the problem i that when i use HIngeContraints, the helicopter reacts to it by spinning the other direction and all that.
Wanted Behavior:
Result:
is there a way to rotate the blades smoothly without it affecting the helicopter, while keeping accurate collision for when the blades get damaged.
Setting it massless doesn’t actually make it massless, it only becomes massless when its welded another part that has mass. This doesn’t apply to parts connected with a constraint
Oh okay, I didn’t know that.
You could try enabling custom physical properties and setting density to 0 (or as low as it will go). If it doesn’t go to zero, it wouldn’t be a perfect solution, but it would be a temporary solution.
And @ThatBushyZaza.
What if you set both the rotor Part and the mast Part to Massless?
Constraints have strange behaviour when the 2 items they join have different Densities.
Or make the Rotor Density .001.
Or use a HingeConstraint but set it to None instead of Motor, then use RotationalVelocity on the blades to spin them.
I don’t know of a constraint which can do this without Reaction forces (opposing forces), so my method would be to either use a AlignOrientation and lock the main body to a certain axis, or to script the animation for the blades. Something like this
local RS = game:GetService(“RunService”)
local propeller = workspace.copter.blade
RS.Heartbeat:Connect(function(dt)
propeller.CFrame = propeller.Parent.Base.CFrame:ToWorldSpace(
CFrame.new(0,5,0) * —Offsets the blade above the base
CFrame.Angles(0,math.rad(propeller.Orientation.Y+60*dt),0) —Increments the rotation of the propeller
)
end)
If you don’t like that, Use a rigid constraint to connect the propeller and the base, and increment the rotation of one of the attachments.
local RS = game:GetService(“RunService”)
local propeller = workspace.copter.blade
RS.Heartbeat:Connect(function(dt)
propeller.BaseAttachment.Orientation += Vector3.new(0,60*dt,0)
end)
the both massless option doesnt work, the none actuator still produces reaction forces, the closest to what i want was the rotor density, but even that it does go completly away
Probably not the answer but would adding a tail rotor correct this turning? Or could you maybe add the rotation in the opposite direction at a way smaller speed to the main helicopter?
it seems the only option i found was to use manualwelds and editing the c1 property to make it spin, the only issue now is that it doesnt look smooth, especially at high speeds
edit: it actually it smooth if the code running it is on the client and not on the server, so that will work for now
local motor = script.Parent.Weld
game["Run Service"].Stepped:Connect(function(t, dt)
motor.C1 *= CFrame.Angles(0, dt * speed, 0)
end)
Just throwing out some other ideas, I know you solved it.
Strange that a Hinge Motor set to None produces an opposite reaction.
If it is the same rotation would it possibly be the Friction between the blades and the mast? Would be easy enough to check by raising the Mast Attachement so they didn’t touch.
Or possibly switch the Attachment0 and Attachment1 of the HingeConstraint to see if only one of them causes the force.
This is just a suggestion but maybe using motor6d could be the solution u are looking for.
Making doors using constrains is a pain because it would always interact with the walls, when u use a motor6d it completely ignores and goes through them, and u can make it spin forever by just changing the MaxVelocity(something between 0.1 and 0.01) and DesiredAngle(math.huge).
U could also make it a rig and create animations for it too.
Constraints sometimes freeze up when networkownership passes back and forth to the server.
As far as the wobble, do you have AerodynamicForces true on the blades? If so try making it false. Are you sure the center Attachment is actually at center. If not it would cause the blades to be out of balance.
Ok so i figured it out, basically i created a part with the size of 1 by .25 by 1 studs and made its density 0.01, which due to its small size makes the mass effectively zero. i then attach it to the helicopter with a HingeContraint and set it to motor. now i can just weld any visual parts to it and make those parts massless. No counterforce, no wobble, and the helicopter behaves just fine.
huge thanks to everyone who replied since it ended up giving me the idea.