Color Attributes acting like integers
ADSentertainment
Member Posts: 397
I'm trying to make an object that will change it's red and green attribute to a random value between 0.2 and 1. but after testing them and looking at the debug screen, their values are either 0 or 1. I used the random function and did not type it in directly (I hear that doesn't work) do you have any idea of what might be the problem? Also, the initial value for the 3 colors before they change is Red=0.5, Green=0.5, and Blue=0 here's a screenshot of what I did in case you need one:
Having trouble with your game? Sounds like a personal problem.
Comments
Change attribute to random(51,255)/255
Or, Change Attribute to random(200,1000)/1000 :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
We are watching you and your new fangled maths, with these so called 'decimal places'.
:o3
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
random(2,10)/10
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
And just for the record, @ADSentertainment , the way shown by tatiang is for 1 decimal place only, two decimal places would be random(20,100)/100 and for three decimal places, as I put earlier. It just depends on how much choice of colour variation you want. And that's no joke.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Having trouble with your game? Sounds like a personal problem.
Having trouble with your game? Sounds like a personal problem.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Having trouble with your game? Sounds like a personal problem.
Having trouble with your game? Sounds like a personal problem.