Hi
I personally understand your struggles, I started off the same way you did years ago.
I create a simple blueprint graph to visualize an example on how to tackle the raycasting from touchscreen to an actor, and then have that actor call a function.
( node graph: TouchScreenANimation posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4 )
So what I do here:
- I get an Input Event, which returns me a location (in the form of a Vector3, but it is in fact a Vector2 representing the screen position of your touch input).
- I then Deproject that location to world, so I know where the touch happened in the Worldspace of my scene.
- I then do a linetrace, from the position i touched the screen, in the direction away from my screen with a maximum distance of Max Hit Distance. (for convenience I ignored the player pawn so the hit is not blocked on the way)
- From the hit result i get the actor and I cast it to the actor type that has an animation. (So this could be your door), and call a function in that actor that will handle the rest for itself.
note that you could also implement this logic in your pawn, or anywhere else. This actor will need to be in the scene, and will need to have Inputevents enabled.
Hope this might help you a bit.