Search Unity

Track game object hovering

Discussion in 'Getting Started' started by Ulrichbraith1, Dec 30, 2021.

  1. Ulrichbraith1

    Ulrichbraith1

    Joined:
    Dec 30, 2021
    Posts:
    1
    I have a MonoBehaviour in my project that creates two game objects, a canvas and a button inside it. How can I track the hover of that button or canvas? From all tutorials and forums I looked through, I know I can use OnMouseOver() but the game object must have a collision for that. How can I add collision through code? Or is there some other way? Site
     
    Last edited: Jan 1, 2022