GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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

Answers

  • tatiangtatiang Posts: 11,796Member, Sous Chef, PRO, Senior Sous-Chef

    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

  • SocksSocks London, UK.Posts: 12,822Member
    edited March 2015

    . . . 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

  • tatiangtatiang Posts: 11,796Member, Sous Chef, PRO, Senior Sous-Chef

    I never liked those 16,777,208 colors, either!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Quantum MechanixQuantum Mechanix Posts: 19Member

    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.

Sign In or Register to comment.