So I’m trying to set up some functionality for the player to be able to interact with objects based off a line trace. So far, my setup works for allowing the player to pick up and manipulate physics objects but now I want to be able to use the line trace to trigger opening doors etc.
The above screenshot shows both the event graph of the Player Pawn setting up the line trace for the interaction and in the yellow inset, the event graph for the Cupboard door that I want the player to be able to open (made it really simple for testing purposes).
I would have assumed that a line trace would count as a “hit” to trigger “on component hit” but it doesn’t seem to. As you can see in the below screenshot, the Interaction event is happening but the cupboard blueprint isn’t registering the hit result.
Thanks Marco I. for the suggestion (don’t know why your comment isn’t showing) but it didn’t help. I did a bit more digging and apparently you have to cast from the line trace to a specific blueprint and then you can apply rotation to the object. I got the door to rotate as I wanted. Now I just have to figure out how I can create a parent blueprint that I can build all the other blueprints from so that this can work with a wide array of objects rather than only one.
Here’s my updated pawn event graph for those who are interested. I’m going to put together a tutorial on how to do this once I get it sorted out.
So after figuring out what I wanted to do and how to do it, I decided to create a tutorial showcasing how to create a dynamic interactable object with Blueprints. You can watch the tutorial on my Youtube Channel here: