Multiple instances of a spriter object?

0 favourites
  • 3 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • So, I've been facing this issue for a few days now and I don't know what to do at this point. I have 2 spriter objects. Player and Enemy, and I have the spriter objects pinned to a PlayerMask and EnemyMask respectively. When the masks are spawned they will spawn the player or enemy. So I have values and platform behaviors tied to the masks, and when the health of the enemies reach zero they'll be killed and dissapear. The problem is with multiple enemies when the health reaches zero, they'll all play the death animation and dissapear. I've read online about the issue but most hadn't really worked. Is there a way to fix it?

    These are the events

    I even tried switching the events to not use functions. That never worked, I tried doing this but it never worked either. Heres how the problem looks in action too

  • Any ideas? I tried matching ID's but that didn't work

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The best way to deal with this is to add Player and PlayerMask into a container. And same with the Enemy and EnemyMask.

    This way when you create an EnemyMask instance, its own Enemy instance will be created automatically. And they will be logically linked. So, for example, if you pick Enemy in an event, its EnemyMask will be picked as well. Read about containers, they can really help here.

    Also, it's not recommended mixing Physics with Platform or any other non-physics behavior. And I don't know much about Spriter, but I'm guessing it's not very compatible with physics either.

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