HingeConstraint not working properly

I’m making a cannon and using a HingeConstraint to rotate it, but when I set the “AngularVelocity” property to 0.1, sometimes after a few seconds it stops turning.

I have checked that the value is indeed staying at 0.1. I have attempted to move the 2 objects up and down that have the attachments/HingeConstraint. Nothing seems to work. Any tips, it’s one of my first times working with Constraints.

Edit: To elaborate, the movement will be fine but suddenly stop when rotating left/right or become stuttery. To make the object continue to rotate I have to set the AngularVelocity to 0 then back to 0.1/-0.1.

3 Likes

Hello,
You need to provide more information, however, your problem may be because the MaxTorque value is 0, so, try something like 100000 in MaxTorque.

Apologies, I’m not very familiar with constraints. I provided the properties.

No problem. The problem is you need to put AngularVelocity as 0.1; MotorMaxAcceleration as inf; and MotorMaxTorque as 100000.

Still seems to result in the same issue. I’ve attempted to manually set it while the game is running and also have the same issue.

Having the same issue. Hopefully this gets fixed soon or someone guides us in the right direction.

Just to add on: If I keep toggling a property (let’s say “Massless”), it’ll do a little jump before stopping again.

3 Likes

I have no clue if you’re still on this thread or need it, but I found a crude solution to my cannons, where I have a hinge constraint connected between a small block and one of the rotation parts, and have it repeatedly switch back and forth on the forces. It literally “forces” the parts to be awake, although you kinda have to be finicky about it.

1 Like

It might be because your angular velocity is .1, same thing happened to me I tried making a spinner and the angular velocity is .4 below. It doesn’t work but when I tried putting .5+ it worked.

The solution is making a script that loops through enabling and disabling every 0.5 milliseconds.

while true do
	script.Parent.HingeConstraint.Enabled = true
	wait(0.5)
	script.Parent.HingeConstraint.Enabled = false
end

If you swap the true and false it won’t work and if it’s jittering a little try reducing the wait time until it stops :smile: