So, I know how to delete an object when another object collides with it. But how do I do it so after clicking on a static icon (think of simulation games like simcity and others) it enables my mouse arrow to delete an object when I click on it?
In simcity, there’s usually a bulldozer icon and after clicking it, it enables your mouse arrow to delete something you didnt want in the game scene, that’s what I want to do.
Then you can check if the bulldozer is enabled with a bool somewhere. For example a script that contains whether bulldozer is enabled. Then when the Player clicks on the BullDozer icon, set the bool to true. Check this bool before destroying the object eg:
If you’re going to have multiple icon selections like BullDozer, Build, etc. Then i would suggest creating a script which controls which one is selected. Then just check which one is selected in OnMouseDown.
In scene view, go GameObject > UI > Button (Text mesh pro). A canvas will be created if you don’t have one. Then link this button to a script by writing a function in a script, called say ‘EnableDozer’. On your button there is a script where you can link button clicks to scripts and functions in those scripts.
Please post the script where this isn’t working. 2018.3 has been out for a while, and if Destroy was broken in it this wouldn’t be the first we’ve heard of it.
alright. i will work on that tonight. I had to stop that and work on something else thats very important to the game too. I was trying to get isometric to work but I have no idea where the person in the tutorial got her tilemap from because I dont have that whatsoever even though there are the isometric options.