Download

Can I take input from player through the light switch actor?

Can I add a keyboard event to this by using this light switch Actor and not my ThirdPersonCharacter BP? I was trying to add it as a condition after the player overlap but I couldn’t figure out where to stick it, it seems like I’m doing something wrong. The BP above shows my attempt without adding a keyboard event

What’s the end goal? Player approaches a light switch and interacts with it? This interaction should sit in the player blueprint, not in the switch - imagine doing this for every switch in the game…

Also, you should not be enabling input on actors. It will make handling input very tricky further down the line.


Do tell how it’s supposed to work. Perhaps I’m missing the point. If you must have Input in the switch blueprint. Hook up the player controller to the Enable Input node, and use Input normally, as you would in the Player blueprint.

My worry is that I’ll end up with the third player controller event graph looking very cumbersome with lots of Actions because it will be handling all my actor events, I figured going from the actor to the player is a cleaner way to work. But the way you make it sound I guess I’m wrong…

lots of Actions because it will be handling all my actor events

What kind of actions / events are we talking about? Perhaps you want to look into Interfaces. The player has only one key

  • Press E to Use

…and the object its used on can interpret that call any way you want. If you E the switch - it will turn on the light, if you E a bucket on the ground, you will kick it.

1 Like