How to pin at offset without rotation?

0 favourites
  • 3 posts
From the Asset Store
In this template the music plays without looping in your game
  • Hi,

    I was wondering if there's a way to pin object A to object B at an X,Y offset to B's origin and have the offset respected when object B rotates?

    e.g. a health bar pinned to a top-down enemy: the health bar is at 0,-32 relative to the enemy's origin; if the enemy rotates 90 degrees clockwise it should remain at 0,-32 not move to 32, 0.

    I've tried using the pin behaviour and hierarchies but in both instances A changes its position as B rotates.

    I'm currently repositioning A every tick, which works. I could add a blank sprite to the container and pin both the A and B to that, but was interested if there were any techniques using existing behaviours that didn't involve adding in an additional sprite.

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, you can do this with hierarchy. Add A as a child to B and disable "transform angle".

  • Yes, you can do this with hierarchy. Add A as a child to B and disable "transform angle".

    Thought I'd already tried that - evidently not! Cheers :-)

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