c# - Disabling mouse Input to a GameObject -
is there way in unity disable mouse inputs gameobject without removing/disabling collision box?
i want write script ignore mouse input of object after pressed once. it's not hard within scope of script, want other scripts on objects ignore mouse input without modifying other scripts.
according onmousedown documentation
this function not called on objects belong ignore raycast layer.
so, 1 way of doing switching layer of object ignore raycast.
this.gameobject.layer = layermask.nametolayer("ignore raycast"); but if have other functionality depends on raycasting, disabled (unless raycasting in other layers).
Comments
Post a Comment