Expected Behaviour: the HingeConstraint must move to the “TargetAngle“ at the speed set by the “AngularSpeed” property
Actual behaviour:
The HingeConstraint stops moving prematurely before it reaches the “ TargetAngle” set in the property of the HingeConstraint
It happens with every hinge constraint servo motor used, plus it only happens if the servo speed is set from 0.1 to 0.9 (very slow speed)
And even it happens across many games with hinge constraints set as servo motors that move at a slow speed,
Even one of my friends saw it in a game.
This is where me and one of my friends experienced this malfunction
Well, it only happens on HingeConstraints as servos. When I tell it to go to a specific position it may prematurely stop before it reaches the target angle. This can be fixed by increasing the speed but some applications may need slower speeds but it doesn’t really work.
You described my experience exactly. Thank you. In my case I need/want the very slow speed, but I was using the hinges in motor mode. < .5 The stall at slow angular velocities happens there too. I’m concerned that you say it only happens on HingeConstraints as servos. It happens as motors too. I provided an example script in my last post that reproduces the problem.
Here is another reproduction of the problem. The spoon on the right stalls. The accessories next to it won’t rotate unless the angular velocity is >= 1
@Rileyg1974 The behavior that you both are observing is a result of the physics sleep system. When parts are moving “slow enough” that they are essentially not moving, the physics engine puts them to sleep to improve performance (see this post for a more detailed description). The sleep system includes a set of velocity tolerances. If a part is moving below the velocity tolerance, it is considered not moving, and goes to sleep.
To see when parts are asleep or awake in Roblox Studio, you can go to File → Studio Settings → Are Awake Parts Highlighted. For the repro that @iondrive posted, the part is initially awake (highlighted in red), and then goes to sleep (highlight disappears):
Since the part is moving very slowly (below the velocity tolerance), the sleep system decides that this part is not moving and puts it to sleep. Note that this can happen regardless of the type of actuator used to move a part, so it’s possible to reproduce the behavior with servos or motors driving any type of constraint.
The simplest fix is to simply use a higher servo/motor velocity to ensure that all parts are moving faster than the velocity threshold. Please let me know if this is a workable solution for you!
Now I understand, thanks. The hingeconstraint is used to twirl an accessory on display, so it can be viewed from all angles. If it is not moving very slowly, it is difficult to get a good look.
i get it now, when Roblox detects a part that isn’t moving, it puts it to sleep to prevent performance drops. That’s why the vane on the air conditioners stopped moving! So when the part isn’t moving the outline disappears! The outline is attributed to “Awake Parts Highlighted”. That makes sense I understand a little more about Roblox’s physics engine
Servos are pretty buggy. Overshooting the target angle causes retargeting issues where it constantly bounces around with too much force. High amounts of torque should help reach the target angle more, but it causes more retargeting.
You got it! We’re currently putting together additional documentation of the sleep system on the Creator Hub which will provide even more detail, stay tuned!