I’m making a 2D game in which I need to use attachments for various reasons like constraints, etc. I have an issue that causes attachments to move overtime as small inaccuracies cause their parent to exit the 2D plane by small amounts.
I’m trying to figure out how to lock the attachment while still keeping the local position the same even if the parent exits the 2D plane. Could anybody help?
Hi. I hope this made it a bit more obvious why I need it to be locked but I can see why you are refering to the XY problem. More specifically I need to connect a custom rope made with Hinges while still allowing certain rotations which can cause the attachements to exit the plane (if the local position isn’t ZERO).
Ok yeah that explains it more, you can just use one of roblox’s features called the PlaneConstraint for this.
I thought you were refering to a random attachment just floating in the sky, not much to go off from there.
I don’t want the attachment getting offset in case for some reason the object exits the plane. It might never happen but I don’t want taking the chance of this happening.
I don’t think I explained this quit right. The current system I’m using to lock attachments to the 2D plane breaks if the parent exits that plane. Even if I use a PlaneConstraint, there will problably be some case where the parent might still exit the plane for a single frame which will create an offset everytime it happens.
Also in my case, I still want the parent to be able to rotate in a way that exits the plane in which case the same issue will happen but this time in intended conditions.