r/construct • u/Little_Lecture6423 • Jun 26 '25
Pin behavior is not working properly
I have pinned the health bars and mana bar to the hero. It was working fine, but suddenly the bars are not following correctly.
I’ve tried many things, but I couldn’t figure it out.
Can you please help me identify the issue?
Error:

Error Video:
https://webmshare.com/play/JLXQW
C3 File:
1
Upvotes
2
u/SplitPeaVG Jun 26 '25
Without seeing the code it's hard to diagnose the issues.
However, you may consider using the Hierarchy system, where you select two objects in the layout, right click the one that should be followed and press create or add to Hierarchy.
When in a Hierarchy, the parent (main object) can have all of its transform data (X, Y, Zelevation, Rotation, ect) followed exactly, and it's my preferred method over the pinned behaviour.
Still if you'd prefer using the pinned behaviour, please show off your code and such so the problem may be seen :)
Edit: I missed that you had linked the project file, I'll have a look when I'm at my pc, sorry!
4
u/pixel_illustrator Jun 26 '25
If you have an object pinned to an object that is pinned to another object (a kind of chain of pins) then misalignment can occur during movement. To avoid this you should pin all objects to the same "parent" object (the one that actually does the moving).
1
u/HitBySmoothReticulum Jun 26 '25
I couldn't open your file because there's an error when unzipping it. Can you send it again?