How does this Touch Input Event works?

342804-annotation-2021-06-30-130301.png

Can Anyone please tell me how this event works?

I know its very basic question. But there is no basic answers out there.

I tried all tutorials on YouTube. Most of them are about controlling the camera with touch and they get complicated.

I tried simply print string with pressed exec pin. Didn’t work!

How to use this event?

I tried simply print string with
pressed exec pin. Didn’t work!

What blueprint did you try it in? Player Controller / Pawn / LB or just a regular actor? It works as is, perhaps you forgot to enable input for the actor. A node like this should not be used in a regular actor anyway.

regular actor

Why not to use it in actor blueprint? How you came to know it when you were learning? And where can I learn this all?

Thanks this info. was really helpful

And where can I learn this all?

And from my 2¢ below:

Why not to use it in actor blueprint?

  • because it dramatically and often irreversibly complicates input handling
  • because you may have 20 actors in the level and when you press Space, all 20 will jump… (you may want this but usually don’t)
  • because input is (and, in most cases, should) be consumed when used
  • because it’s not the actor’s role to handle input
  • because there is a better place for it - Pawn or Player Controller - they are the ideal input instigators and processors
  • because of order in which input is handled (check out the Input Processing Procedure in the link)

By default, input is disabled for regular actors:

How you came to know it when you were
learning?

  • 40% digging through documentation
  • 20% experimenting (by failing and figuring out what works & what does not)
  • 10% helping others understand it better
  • 10% digging up Forum posts and sifting Answer Hub
  • 40% - stuff I still don’t know

That’s like 120%…, I know. Assuming here there are things that I don’t know that I don’t know yet. :wink:


Place that node in the Player Controller / Pawn or even Level Blueprint and see if it works then.

1 Like

Regarding Input Consumption:

342767-screenshot-6.png

By default, if you use input, it is considered Consumed - used up and nothing else can process it.


And regarding Input Processing Procedure:

The usual order is in the link, but when it comes to regular actors implementing input:

342769-screenshot-7.png

This value decides which actor receives and consumes it first providing nothing else consumed it.


But as a general rule of thumb, you want all input in one place rather than scattered between many blueprints. This explains it well:

1 Like

Hello its working in level blueprint. But Not in pawn BP. I enabled touch inputs events in player controller also assigned that controller in GameMode. Touch Begin Events works though anywhere.

Are you possessing that pawn?

Touch Begin Events works though
anywhere

… well, almost 100% certain you’re running into the very system I just described above. :slight_smile: If you use the same input in more than one place - only 1 will work, the actor that gets to consume it first. That’s precisely why you should keep input in 1 place. Look at the order of input processing from the link:

If you process something in an actor, level blueprint or the PC first… well, the Pawn is last to receive it and may never get it.

1 Like

Touch Begin Events works though
anywhere

If you’re talking about actor specific events / dispatcher of the components:

343189-screenshot-5.png

These are not the same. Not sure I understand your issue at this point.

The InputTouch does not print “Hello” But event above that works in Pawn BP… And Also I don’t any more Inputs than these in whole project. I am just experimenting to see the outputs and clear basics.

does collision matter for touch events.? I haven’t build any collision for my imported fbx file as its more of a puzzle type game.

Also, Now I changed the parent class to Actor. The touchInput Started working but begin touched stopped working. Then I changed it back to Pawn Parent class. Now Both doesn’t work.

I am experimenting a lot. But not getting any conclusion from it. :slight_smile:

Edit: Just realized what stopped my Touched Begin event - setting Collision to No Collision

1 Like

The InputTouch does not print “Hello”

Not sure what else you’re doing there but this works fine:

re: fine - I find it hard to imagine a scenario where this would be useful / helpful / needed. If you do this, you actually no longer know what you’re touching because any actor now registers it. You’re not actually touching the actor here, you’re touching the screen and every actor tries to report that touch… Super confusing for everybody!


And Also I don’t any more Inputs than
these in whole project.

So… how many hexes are in your game? 1? See what I mean? You surely have more and every one of them will try to process and consume it. If you do it like this, you actually don’t know which one did.

Why are you even trying to have input in the actor. As explained above, this is the last thing you generally want. That’s unless you after some super-duper unique behaviours.


If you want to touch a Hex actor (and that one only!):

Now, this is completely unrelated to this:

343214-screenshot-10.png

The above if for touching the screen, not the actors. You can have Input Touch in the Pawn / Controller and On Input Touch Begin in Hex actors. And both will work - you will get separate notification regarding touching the screen and specific actors.

1 Like

Edit: Just realized what stopped my
Touched Begin event - setting
Collision to No Collision

Yes, collision matters - touch & clicks use this channel for queries:

It must be blocked. Which channel to use can be adjusted in the Player Controller and new channels can be added (perhaps you want to touch Invisible Ghosts enemies)

1 Like

Thanks This helps a lot. I was trying to that Input Touch event in there because, you said to keep all inputs in one place. But I didn’t thought about number of pawns I have in the game. Thanks for explaining it in so easy way.