Calling Attributes Created Inside an Actor from another Actor

Goodnight GamesGoodnight Games NYCMember, PRO Posts: 184
edited July 2012 in Working with GS (Mac)
I'm currently making a game with enemies that have health that are dynamically spawned onto the screen.

What I'm trying to do is put an attribute inside my enemy actor for his health. Then when the player hits him I want to be able to subtract from that attribute inside the enemy.

I can do it with the global attributes but since I'm dynamically spawning the enemies it would be a pain in the butt making variables for all of the enemies that can possibly spawn on screen.

Is there a way to call it or will I need to go the long way? I've been looking but so far I'm out of luck. Thanks!

Best Answer

  • tenrdrmertenrdrmer Posts: 9,934
    Accepted Answer
    Why can you not just code your enemy actor

    When collide with actor 1 subtract 10
    otherwise when collide with actor 2 subtract 20
    otherwise etc…..

    Since you are spawning actors you cannot have access to thier values by other actors. You can only do that by unlocking an instance in the scene and selecting a specific instances attributes to alter .

Answers

  • Goodnight GamesGoodnight Games NYCMember, PRO Posts: 184
    They don't really collide it's when a specific set of conditions are met but I'll see if I can't apply that to my statement. Thanks!
Sign In or Register to comment.