Spawn actor with parameters.
Omegas7
Member Posts: 37
Let's say I want to spawn actor with a specific task.
How will that actor know that task? Well, I would use an attribute.
I would spawn the actor and at the same time I give it a parameter (attribute) which the actor will use.
Like this:
spawn_actor(parameter here)
The actor spawns, plus a self attribute which value is the parameter given...
I know this sounds confusing...
For instance, some programming languages do that.
Like Ruby, it has methods that can be called with a parameter.
How will that actor know that task? Well, I would use an attribute.
I would spawn the actor and at the same time I give it a parameter (attribute) which the actor will use.
Like this:
spawn_actor(parameter here)
The actor spawns, plus a self attribute which value is the parameter given...
I know this sounds confusing...
For instance, some programming languages do that.
Like Ruby, it has methods that can be called with a parameter.
Comments
When you spawn an actor, set that game attribute.
In your spawnee prototype, have an attribute called myParameter and use Change Attribute to give it the value in the game.parameter.
There can be who-knows-how-many amount of these spawned actors...
-JGary