playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Join our
Discord Channel
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
(Moderator:
600
) »
Need some help with Picking Random Colors! [SOLVED]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Need some help with Picking Random Colors! [SOLVED] (Read 1274 times)
rizwanash
Junior Playmaker
Posts: 61
Need some help with Picking Random Colors! [SOLVED]
«
on:
May 17, 2019, 12:34:16 PM »
Hello Guys,
I am having some trouble getting random colors for an object, What i want is i have a scene with a sphere in different locations, same sphere being copied and same material, i would like to give all of them random colors whenever the level starts so they do not look the same.
I would like save my list of colors in an Array and then use those as random.
How to achieve that ? Thank you in advance
«
Last Edit: May 17, 2019, 03:44:45 PM by Alex Chouls
»
Logged
drown
Junior Playmaker
Posts: 58
Re: Need some help with Picking Random Colors!
«
Reply #1 on:
May 17, 2019, 01:30:44 PM »
You already mention the answer in your question !
Just make an array containing all the possible colors your sphere can get. I wouldnt recommend random colors as you game should use some sort of art style / colour palettes that work well together.
Store those colors in your array and then make a fsm that uses "Array Get Random" to fetch a random colour from your palette. You could then make another array containing all your spheres and then loop through that array and assign a random color for earch entry in that list. That way you don't need as many FSMs as you have spheres.
Logged
rizwanash
Junior Playmaker
Posts: 61
Re: Need some help with Picking Random Colors!
«
Reply #2 on:
May 17, 2019, 02:29:28 PM »
Hi, Thank you for replying, I am still a beginner to PM, Can you please add little more details for that ? I am using ArrayMaker Package here. Thanks
Logged
Alex Chouls
Administrator
Hero Member
Posts: 4003
Official Playmaker Support
Re: Need some help with Picking Random Colors!
«
Reply #3 on:
May 17, 2019, 03:01:19 PM »
I would use the built-in arrays for this.
Create an Array variable and set the Array Type to Color.
Fill in the colors you want to pick from.
Then use Array Get Random to get a random color from this array.
More about arrays:
https://hutonggames.fogbugz.com/f/page?W1243
Logged
rizwanash
Junior Playmaker
Posts: 61
Re: Need some help with Picking Random Colors!
«
Reply #4 on:
May 17, 2019, 03:28:43 PM »
Awesome Thanks
Built in Array colors worked just fine.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
(Moderator:
600
) »
Need some help with Picking Random Colors! [SOLVED]