When using a script to automatically create and attach a SpringConstraint between two parts, the parts can glitch out unexpectedly. I’ve only tested it with one part anchored, although I imagine it would still glitch out if both parts were unanchored. (After all, this isn’t Scrap Mechanic, where attaching a rope to an anchored object causes your crane to become a helicopter, but unanchored objects are fine.)
Once the constraint is attached between the two, it can result in Humanoids tripping, or teleporting far underneath the ground and instantly dying. It can also result in vehicle wheels becoming glitched, and flying off / teleporting underneath the baseplate.
In my first attempt at doing this, waiting for RunService.Heartbeat (but not Stepped, and not more than once) before putting the SpringContraint into the data model seems to lessen, but not nullify, the effect. That workaround doesn’t work in my minimal repro file attached below, but that may be because I’m attaching the spring slightly differently than I did the first time. (Parenting the Attachments directly to the parts, instead of to other parts that are welded to the parts so the parts welded to the parts have the constraints, but the parts with parts welded to them don’t have any extra Attachments inside of them. Just the parts welded to the parts)
I’ve only tested this with springs so far, but it happens even with springs with 0 MaxForce. Additionally, a humanoid continues to just act weird with springs attached, even if the springs aren’t actually doing anything (0 max force).
This bug happened from the first time I attempted this, so I can’t provide a time where it suddenly started happening. This may have been in the PGS solver from the very beginning, or it may have started happening right before I tried it.
Repro: SpringConstraintThingyRepro.rbxl (68.8 KB)
Basically, to experience the full glory of PGS, walk over the amazing spring attachy part or drive the provided vehicle over it.
These springs have MaxForce = 0 and FreeLength = 0.
A member of post approval speculated that this had something to do with the seat and network ownership. It may have something to do with network ownership, since parts simulated on the server don’t seem to glitch out in my very limited testing (dropping a part onto the magic spring part at different angles in Run mode), but I don’t think the seat has anything to do with it. Probably just the network ownership.
Original post: Attaching constraints trips and glitches out vehicles, humanoids and more