I found a really weird bug in UE. I’m targeting mobile platform. The steps to replicate is this:
- Create an actor blueprint derived from
Actor
class. - Add a static mesh component and attach it to the root component.
- Assign a static mesh to that component.
- Add
OnInputTouchBegin
event to that mesh component. Do a simple print string on that event. - Change the Collision Presets to
NoCollision
. - Put that actor blueprint somewhere in the level.
- Put a camera actor somewhere in that level too. But point that camera to that blueprint actor.
- In the level blueprint, make sure to view the game from that camera by using
SetViewTargetWithBlend
function after eventBeginPlay
. - Play the game in PIE or Viewport.
- Try to “touch” or “click” that actor in the game.
You’ll see that it will not fire the OnInputTouchBegin
event. But if you change the Collision Presets to BlockAll
or BlockAllDynamic
, then it can fire that event.
So what does collision have to do with OnInputTouchBegin
event?