After picking random object from a family can I find out what object it is?

0 favourites
  • 2 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Hi,

    I'm using "Pick a random FAMILYNAME instance" to pick a random object. The object could be one of any 10 different object types.

    I want the object to do a behaviour that is attached to the object rather than the family (they all have different ones). I can't see any way to figure out what object has been selected though. Is it possible? If not has anybody used a different solution to do this?

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can get the object name using Family.ObjectNameName

    But if you need to run a behavior that is added to the object, and not to the family, you will need to pick the object instance. You can do this:

    Zombie Pick by unique ID = EnemiesFamily.UID
    .. Zobmie Restart Fade
    
    Vampire Pick by unique ID = EnemiesFamily.UID
    .. Vampire Enable Bullet
    
    etc.
    
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)