Independent Instance of Same Object
Windmarble
Member Posts: 4
How can I prevent multiple copies of an actor from behaving the same way when clicked?
For example, say I have three squares, all colored blue, when I click one square it should change to red, but all the other squares change to red as well. I would just like the one I clicked to turn a different color.
I was hoping to reuse the same Actor with all its rules.
For example, say I have three squares, all colored blue, when I click one square it should change to red, but all the other squares change to red as well. I would just like the one I clicked to turn a different color.
I was hoping to reuse the same Actor with all its rules.
Comments
I have a rule on Actor1 where after a few seconds Actor2 is spawned and Actor2 follows actor1. I have the constrain attributes on Actor1. So this works fine.
But when another instance of Actor1 is spawned, Actor2 will start following the new instance of Actor1 rather than stay following the original Actor1 instance in the scene.
1) you can create 3 different actors, each with individual rules.
2) you can use the same actor but edit the actors in the scene itself (not the prototype) double click it on the scene
with minor changes.
hope it helps
attribute - "self.what kind of actor am i" to 1, and then you have a rule,
when touch is pressed AND when "self.what kind of actor am i" = 1 change color to red
so that in the other actor which has a different X value, make the sam thing but change it to 2!
and a rule, when touch is pressed AND "self.what kind of actor" = 2 change to blue!
and so on... is that make any sense?
like an instance id (integer)
have the id be autogenerated.
a simple way to do it is:
change attribute id = game.time * 1000 + random(100,5000)
that's pretty unique