Randomly place gameobjects on UI sprites
Hi, I'm working on a board game. The center of the game is a pond of sorts, the edges are distanced randomly, and may change. Basically, it's a blue circle / square something, that may vary in size, surrounded by green.
I want to place grass on this green, to make it look nicer. My idea was to just get the screen, and randomly raycast a number of times on it, see if the color we're hitting is actually green, and if yes, instantiate a prefab of grass on that position.
Any tips on how I can do this? Maybe there's a better method alltogether.
Your answer
Follow this Question
Related Questions
Detect when Raycast DOESN'T hit layer. 1 Answer
Raycast 2d is not working at all 0 Answers
How do I properly do a 2D raycast to avoid problem with pause button? 0 Answers
Does GraphicRaycaster.Raycast produce more reliable results in Update or FixedUpdate? 0 Answers
Raycasting into UI from physical object 0 Answers