Color Changing Will Not Work
So when my player character touches a different actor. That actor is supposed to become a random color. I have other actors running the exact same Change Attribute command: Change self.Color._____ to random(0,1) running absolutely perfectly and I don't understand why this actor won't work. It is using a custom image if that effects anything. Has anyone encounter this problem or found a solution to actors not running commands in general.
Best Answer
-
marc_greiff Posts: 250
Layer order!
sounds like a case of the non working actor being above the player actor in your layer stack. Basically, the collision of the two actors is detected, but the code in the colour changing actor isn't getting a chance to run because the instruction cycle has already moved beyond it in the sequence. Try putting the actor below your character actor in the layer.
Answers
You may have unlocked the actor thereby creating an "instance" with unique rules that differ from the "prototype" actor in the Library/Inspector. Try deleting the problematic actor from the scene and then re-adding it which will force it to use the prototype rules again.
if that doesn't fix it, consider uploading the project folder (.zip it first) to a file-sharing site and posting the download link here.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
. . . also . . . .
Random(0,1) for each of the R,G and B channels will give you a random selection of just 8 colours from a possible pallet of 16,777,216.
If you want to use all 16,777,216 colours, you can use:
change self.color.R to random(0,255)/255
change self.color.G to random(0,255)/255
change self.color.B to random(0,255)/255
I never liked those 16,777,208 colors, either!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
It wasn't an unlocked actor but I found a solution. By putting it in a container(timer, rule, group) inside of the rule I got it to work. Thanks anyways for your suggestion.