Skip to main content
added 4 characters in body
Source Link
Pikalek
  • 13.4k
  • 5
  • 49
  • 54

Is there any way to use UI-Based event triggers on Non-UI objects?

Example : on any UI object, you add an event triggerEventTrigger component, set the event, and then set the actions for the event. Its easy, and clean, to make UI do various actions on things like mouse enter / exit, drag, etc.

For non UI objects (a cube, for example) these kind of things are mostly done through scripts with raycast code. Its not impossible, but I find it messier, harder to organize, and less flexible then the EventTriggerEventTrigger approach.

I'm working on a turnbasedturn based strategy type game. Much of the game mechanics is based around mouse movement and clicking. I tried just adding an on-click event to a cube, but it didn't do anything.

Is this scenario just plain not supported?

Is there any way to use UI-Based event triggers on Non-UI objects?

Example : on any UI object, you add an event trigger component, set the event, and then set the actions for the event. Its easy, and clean, to make UI do various actions on things like mouse enter / exit, drag, etc.

For non UI objects (a cube, for example) these kind of things are mostly done through scripts with raycast code. Its not impossible, but I find it messier, harder to organize, and less flexible then the EventTrigger approach.

I'm working on a turnbased strategy type game. Much of the game mechanics is based around mouse movement and clicking. I tried just adding an on-click event to a cube, but it didn't do anything.

Is this scenario just plain not supported?

Is there any way to use UI-Based event triggers on Non-UI objects?

Example : on any UI object, you add an EventTrigger component, set the event, and then set the actions for the event. Its easy, and clean, to make UI do various actions on things like mouse enter / exit, drag, etc.

For non UI objects (a cube, for example) these kind of things are mostly done through scripts with raycast code. Its not impossible, but I find it messier, harder to organize, and less flexible then the EventTrigger approach.

I'm working on a turn based strategy type game. Much of the game mechanics is based around mouse movement and clicking. I tried just adding an on-click event to a cube, but it didn't do anything.

Is this scenario just plain not supported?

Tagging
Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

Unity3D : Can Event Triggers be used on Non-UI objects?

Source Link
Sperry
  • 143
  • 2

Unity3D : Can Event Triggers be used on Non-UI objects?

Is there any way to use UI-Based event triggers on Non-UI objects?

Example : on any UI object, you add an event trigger component, set the event, and then set the actions for the event. Its easy, and clean, to make UI do various actions on things like mouse enter / exit, drag, etc.

For non UI objects (a cube, for example) these kind of things are mostly done through scripts with raycast code. Its not impossible, but I find it messier, harder to organize, and less flexible then the EventTrigger approach.

I'm working on a turnbased strategy type game. Much of the game mechanics is based around mouse movement and clicking. I tried just adding an on-click event to a cube, but it didn't do anything.

Is this scenario just plain not supported?