Changing actor problem
wolala123
Member Posts: 249
I have 2 different color actor, red and blue. I put red actor on center. When i touch blue button, it change from red to blue actor. But it remains red actor behaviour. Anyone can help? Thanks.
Comments
How are you "changing" the actors? Are you spawning one of the two actors? Are you destroying one of the two actors?
Are the two button actors overlapping in the scene?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang they no overlap ...i am using change image, is it valid?
Either spawn a blue actor and destroy the red actor then the blue actor will have the blue behaviours or do what you're doing by changing the image on the one actor but have an attribute on the actor to flag whether it's currently red or blue, and then have two rules with your behaviours in i.e.:
If self.colourName is "blue"
... add blue behaviours
If self.colourName is "red"
... add red behaviours
In this example I'm using a text attribute called colourName. You would change the attribute at the same time you change the image. You could use numbers i.e. 1 for blue and 2 for red. Whatever you prefer and can easily understand when you look at the code again in a months time.