I’m trying to apply random color to an object but unfortunately the Random() and Variable() expressions can’t be used
in the ‘Change color of object’ action like so:
Change color of object to “Random(255); Random(255);Random(255)”. or using Variable().
So I’m trying to use Javascript to change the color.
I have no experience with Javascript but I was able to use runtimeScene.setBackgroundColor() to apply a random background color and so I’m looking for a similar (easy) way to do just the same with an object.
I was searching all the classes and methods in the GDevelop documentation but I can’t find anything similar to setBackgroundColor() that can be used on sprites or objects maybe it there but it is not as obvious as ‘setBackgroundColor()’.
So, anybody could help me out with this?
Thanks.
EDIT:// Just solved the problem using ‘ToString()’ expression but I would like to still know how to do it in Javascript, if anybody could help would be great
Thanks.