Calling Attributes Created Inside an Actor from another Actor
Goodnight Games
NYCMember, PRO Posts: 184
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!
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
-
tenrdrmer Posts: 9,934Why 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