(New UI) 3D objects as buttons?

Hi!

I am trying to make a Tower Defense game and I want buttons to be the towers as 3D objects. But I can’t get it to work. In the editor, it follows the UI animations and seems to work. But in the game scene, it is gone. Do anyone know how to do this?

Thanks

any gameobject can be made clickable with a simple piece of code…

OnMouseDown is a premade function by unity. It fires when the gameobject wich the script is connected to is clicked.

just add it like this :

function OnMouseDown()
{
//whatever you want to happen when tower is clicked
}