Checking if the mouse is hovering over an entity

Hi all,

I would really like to know how to check whether the mouse is hovering over an entity.


You could attach collision component to that entity (eg. simple box sorrounding that entity) and then use raycasting to check if you are hovering over that entity with mouse:

var self = this;
var from =, e.y,;
var to =, e.y,;

var result =, to);
if (result && result.entity == this.entity) {
    // do smthing
1 Like