0 Favourites

Anchor is not working?

  • Hi there!

    I'm trying to "anchor" an object and I have never had any problems with that before. I'm working on a new game but this time when I play the game in the browser the object that is anchored is seen for a millisecond and then it disappears. Do you guys have any clue what the problem could be?

    Thanks in advance,

    Tomolo Games

  • Hard to say without seeing the capx, but here are a few guesses:

    Run the game in debug mode. Select the object and view its values; you should be able to see a dotted red outline on the layout when the object is selected:

    If it no longer exists in the object list then an action somewhere in your code is destroying it.

    If the red outline appears in the correct position and at the correct size then most likely it has either been set invisible, the opacity has been set to zero, or some other object is obscuring it; you can check the relevant instance values to determine if it's one of these options.

    If the object exists in the object list and the (x,y) coordinates are correct but no red outline is shown then either the object or the layer scale/size may be set to zero.

    If it appears to have moved and the (x,y) coordinates have changed then an action somewhere in your code is re-positioning it before anchoring.

    If it appears to have moved but its (x,y) coordinates stay the same then it may be that you have the origin set to different positions on subsequent frames (if the sprite is animated).

  • First of all, a thousand thanks for replying. I really appreciate it!

    It doesn't work even if a create a new project and start from scratch. I have just created a solid floor, a platform player and an object I want to anchor. Would you mind if I send you the file so you can take a look at it? If you have the time and energy to do so, you can contact me at

    Thanks again!

  • I can also add that when I delete the Anchor behavior the object is visible at all times.

  • Hi Tibolli, sure, you can send the file to or post a dropbox/google drive link here.

  • So what are your anchor settings?

    Left edge = ?

    Top edge = ?

    Right edge = ?

    Bottom edge = ?

    Try setting Left edge=Window left, and Top edge=Window Top, others set to None.

  • I have sent you an e-mail now. Thanks again!

  • "Try setting Left edge=Window left, and Top edge=Window Top, others set to None."

    Thank you for you reply but these are the settings I have already. But again, thank you

  • Tibolli You need to position your anchored object at 0,0; If you run the game in debug mode and check the coordinates you'll see that it still exists and is positioned outside of the viewport, so when anchored it remains outside. Anchoring fixes an object to the specified settings relative to its initial position.

  • I love you, you're the best! Everything works great now

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Glad to help

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)