Maybe someone can see what I'm doing wrongn-random spawn
SaveDave
Member Posts: 140
Hi, I have the following set up but it's not working!
I have 3 actors - frog 1, 2 and 3
I also have a bar which one will colide with, when it colides, I want it to be destroyed and be randomly spawned for one of the selection of 3.
I have an scene integer called randomactor
On the collide bar I have this set:
Change attribute, randomactor = randomactor. Random (1,3)
Then on the frog actor 1 I have:
If actor colides with bar and randomactor = 1
destroy actor 1
Spawn actor 1 in the same position
If actor colides with bar and randomactor = 2
destroy actor 1
Spawn actor 2 in the same position
If actor colides with bar and randomactor = 3
destroy actor 1
Spawn actor 3 in the same position
What am I doing wrong???
Any help would be greatly appreciated!!
I have 3 actors - frog 1, 2 and 3
I also have a bar which one will colide with, when it colides, I want it to be destroyed and be randomly spawned for one of the selection of 3.
I have an scene integer called randomactor
On the collide bar I have this set:
Change attribute, randomactor = randomactor. Random (1,3)
Then on the frog actor 1 I have:
If actor colides with bar and randomactor = 1
destroy actor 1
Spawn actor 1 in the same position
If actor colides with bar and randomactor = 2
destroy actor 1
Spawn actor 2 in the same position
If actor colides with bar and randomactor = 3
destroy actor 1
Spawn actor 3 in the same position
What am I doing wrong???
Any help would be greatly appreciated!!
Comments
Sorry!
Anyone?
Pleeeaaassseeeee
However, I did notice something of importance. If you're going to do spawning and deleting within the same rule, the spawning should be first. Otherwise, the delete behavior will likely delete the actor before the spawn behavior can activate.
Behaviors are launched top first, like words in a book are read.
How would you go about this?
If actor "Overlaps or Collides" with "Wall"
Change attribute self.random to random(1,2)
--If "self.random" is "1"
--Spawn actor "A"
--destroy actor
--otherwise
---Spawn Actor "B"
---destroy actor
Is that correct??