Use the Turret behavior to mirror the enemy.

Not favoritedFavorited Favorited 0 favourites
  • 5 posts
From the Asset Store
Sync animations, animation frames, mirror state, sounds and anything else using these methods.
  • I have a support soldier character who should follow the hero character automatically.

    The hero can move left, right, and jump.

    The support character will only move left and right, following the hero.

    The player has no control over the support character—it should behave like AI and shoot enemies.

    For the support character:

    - I have to sprites: "soldier body" and "hand with gun".

    - "Soldier body" has the Platform behavior.

    - "Hand with gun" has both Pin and Turret behaviors.

    - There are multiple enemies, and the Turret behavior automatically picks one to shoot.

    Problem:

    When the turret is shooting and the "soldier body" is not facing the enemy, the turret flips, but the soldier body does not.

    I want both the "soldier body" and his "hand" to face the specific enemy he is shooting at—regardless of movement direction (left or right).

    I’ve tried using enemy.X to mirror the "soldier body" and "hand", but it doesn’t work correctly when there are multiple enemies.

    I want the support character to mirror based on the specific target the turret is shooting at, not just any enemy.

    Create Event:

    Shoot Event:

    Error Video: webmshare.com/play/qOvP7

  • The Turret behavior is mostly intended for top-down games. In a platformer, especially if you’re only shooting left and right and there are no flying enemies, you usually don’t need it.

    My advice: don’t use the Turret behavior. Pick the nearest enemy and spawn a bullet in its direction.

    If you really want to use the Turret behavior, create an invisible sprite just for it. This way, you can combine the character and the gun in one sprite and mirror them easily.

    Also, use hierarchy instead of the Pin behavior — child objects in a hierarchy will automatically mirror when the parent sprite is mirrored.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't know much about turret function but would using -pick nearest,furthest- help?

    edit-sorry I just saw dop2000 already wrote this silly me

  • The Turret behavior is mostly intended for top-down games. In a platformer, especially if you’re only shooting left and right and there are no flying enemies, you usually don’t need it.

    My advice: don’t use the Turret behavior. Pick the nearest enemy and spawn a bullet in its direction.

    If you really want to use the Turret behavior, create an invisible sprite just for it. This way, you can combine the character and the gun in one sprite and mirror them easily.

    Also, use hierarchy instead of the Pin behavior — child objects in a hierarchy will automatically mirror when the parent sprite is mirrored.

    Thank you very much, i will try alternative for Turret

  • I don't know much about turret function but would using -pick nearest,furthest- help?

    edit-sorry I just saw dop2000 already wrote this silly me

    Thanks for the suggestion

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