Changing Spawned Actor Attributes
jasonpbruce
Member Posts: 35
How do I change a actor that gets spawned onto a scene to change it's attribute relivent to the current scene? For example I have a spawner creating enemy fire... everytime one gets destroyed it should change enemy count -1 for the enemies in the scene. Problem is when I go into the actor prototype it doesn't give me an option for "current scene" attributes. I only get that option when the actor is edited in the scene. Any thoughts?? Thanks!
Comments
Specifically, I have 5 spawn points, and I want them all to spawn an actor moving in separate directions (ie, 2 spawn points will send the spawned actors in the negative X axis, and the other 3 will send them positive X)
If you need more clarification please ask. Thank you!
Spawner actor
------------
Change Attribute game.spawnDirection (angle) to [some value]
Spawn Actor [Moving actor name]
Moving actor
-----------
Change attribute self.myDirection (angle) to game.spawnDirection
Move [some speed] [game.myDirection for the direction]
Not sure if that all makes sense but it works and I've used it to great effect in my health bar demos in the Spare Code Dump It Here thread.
If you have questions, explain a bit more about what you're trying to do first. It sounded to me like you wanted to spawn five actors and have them move in set (non-random) directions once they spawn.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
However, I think your method is alot cleaner and more robust.
Thanks tatiang! I appreciate your quick response.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User