Help with game script

Hi everyone,

I’m making a 2D unity game for a school project where you control a cloud and float around and water/manage the world’s climate. The world rotates when the left/right keys are pressed and the cloud remains stationary. With the up key, you are able to evaporate water from lakes/ocean/rivers and then using the down key water forests/cities.

I’m not here to ask you to script my game, as I can usually work that out for myself. But I’m new to scripting, so I was wondering whether I would use raycasting for the cloud to recognise what it’s currently hovering over. Or would I use some form of current position of the world.

Any other questions/suggestions would be much appreciated.

318065--11215--$gameplay_139.jpg

I’m no expert, but I would use raycasting. It’s the easiest solution that I could/would have thought of(If I was in your position).

I think a trigger would be just perfect in this situation as it’s easy to use, accurate and wysiwyg. Make it a child of your cloud and position it below the cloud and just above the planet’s surface so that everything sticking out hits the trigger. Then all you gotta do is check in the OnTriggerEnter()/Exit() events what you’ve hit, maybe by comparing tags.

Yeah, raycasting seems like the obvious answer but I already knew triggers so it was just easier doing it that way.

Thanks guys.