Hello guys!
I need some help on making a BOLT system.
I tried with prismatic constraints but
I mean, I am just changing .Target Property, but it glitches like that, and it’s laggy
Hello guys!
I need some help on making a BOLT system.
I tried with prismatic constraints but
I mean, I am just changing .Target Property, but it glitches like that, and it’s laggy
This happens because when you enter first person, moving your head around only updates CFrames, and really quickly. The PrismaticConstraint (and other physics constraints) rely on parts’ velocities and positional correction to stay in place. It’s keeping it’s position via simulation, rather than something like a weld which would “lock” your part’s positions together. Moving your head in first person updates CFrames really fast and without setting any velocities, so the part connected with a Prismatic is just trying to catch up with positional correction.
A general rule of thumb is that for any given model, if you want to use Constraints, you need to stick to using constraints and moving parts via velocity and forces. Otherwise if parts in the model moving by updating CFrames, you’d be better off using Motor6Ds to update transforms and play animations.
Small bonus addendum to Klepto’s post. Can’t help myself.
How much positional correction can move an object per frame is very limited and conservative. Constraints mostly work by solving for new velocities of bodies to keep them aligned. Like a BallSocket mostly tries to make the linear velocity of the two attachments match. Making the positions line up is secondary: if the velocities match they should stay aligned.
We still need positional correction to correct misaligned starting configurations, or numerical drift when non-linear behavior (like the circular path traced by rotations) means the inherently linear solver can’t match the true physical motion. For example, when you position one object inside another it’s positional correction that depenetrates them. It’s the velocity solving that keeps it that way.
Positional correction does artificially add or drain a tiny amount of energy from the system. E.g. pushing a part up or down can raise or lower it’s potential energy. This is why we limit how much positional correction can correct. And that’s why your bolt lags behind as much as it does.
You generally want to avoid leaning on positional correction because of this. Something like shortening the length of a rope to move a part is relying on positional correction too! No actual force involved ![]()