No Input event nodes in Actor component blueprints?

(Unreal 4.7.2)
I don’t know if I’m doing something wrong here. If I add an actor component blueprint to an Actor and then edit its graph, I cannot find the input event nodes, which instead work perfectly in level or actor blueprints.
Is it a wanted behaviour?

Yes. A component is something you add to objects or actors. You will not be able to add other components to it or get a good chunk of events. If you look at currently existing components they do provide functions but never directly interact with anything by themselfs. This only causes hard to track down behavior especially if you’re working on a team.

In general. Input should always only be handled by the Controller and maybe the Character. But nothing else.

However for example with a movement component you can define how it should move and just provide those functions to the actor you attach it to. Then it’s like three nodes or something like that to set up the actual movement but instead of only input you can also use the same component for AI actors and the like.

Cheers

Thanks! I guess the source of my confusion is Unity, where you can add script components which handle pretty much anything. Anyway, this conceptual separation makes sense.

Really? It introduces hard to track down behavior when you centralize your input into a single place, instead of copy and pasting the input handlers into every single blueprint? shakes head

Centralize? Components would cause quite the opposite.

I’m sorry but if you want to centralize your input you should not use a component. Keep in mind that this is not unity. The whole structure is different.

Unreals structure highly suggests to use a centralize your input. Inside of the player controller to be precise. This is fundamentally different from unity in the way that you simply always have one. You can handle input from anywhere. Unreal is not artificially restricting you in this regard. But the only way it automatically receives input is your controller.

You aren’t restricted to only those scripts which you can pin on. And not relying on user input in your character or components allows you to use exactly the same once for your AI and only have to worry about basic event handling in there.

No one ever said Unreals components are like Unitys.

I’m terribly sorry if this sounds a bit harsh… it’s just… that’s a really major misconception you have there :wink:

It’s worth noting that you can bind input events to Actor Components, just not the the preset input events.

Use ‘Is Input Key Down’, for example, as shown in this blue print:

That’s helpful, but you can’t use input mappings this way…
It should really be possible to just bind code to input events like in any other event graph.

I wonder what’s the point behind all those ‘enable input’ nodes then if they don’t work anyway…?

Erasio, while I agree that components would decentralize input controls, I do not think that the adverse effect would be as bad as you think. In some ways, it is conceptually better, particularly if you are using action mappings through the project settings.

Consider this, I have a skills component. Everything even remotely related to implementing skills is contained in this component. If I created an action map for, say, Print Skills, as a debug tool, and bound it to a function key, why would I want to handle that input anywhere EXCEPT the skill component. If I put it anywhere except the skill component, it is adding a interface function call/message to a component that may or may not exist. By keeping the input that is specifically related to, and only needed by, the component, it removes the possibility of bugs being introduced because a component is missing or does not exist.

This is another area where designers and developers should be able to make the choice of how to design their architecture, and not be forced to do what the engine developers think is best.

1 Like

Just a note: I am still not being able to create different controlling schemes thanks to that restriction and having to use complex and error-prone workarounds with huge amounts of redudant code instead. Please remove it.

Custom event dispatchers can help work around this issue, too.

Here’s a setup I put in a Pawn Blueprint that just broadcasts the appropriate Event Dispatcher whenever an Input Event fires. Any code in any other Blueprints (including Components) bound to those events should execute when the Dispatcher is called just as if they were linked directly to the input events.

(BTW, as Virtual Reality becomes more prominent, I think the value of custom component blueprints that can handle input events is growing… Unreal represents VR motion controllers through components attached to the player pawn, but when those Motion Controller Components can’t directly process their own input events, things can get complicated – especially when you’re dealing with dual left- and right-hand motion controllers.

If you want to be able to set up the same scripting once for both hands, but only have that code execute when events fire on one or the other hand controller, this is much more easily accomplished directly in the Motion Controller component instead of setting up a bunch of hand-based flow-control checks in your pawn BP.)

117165-inputeventdispatchers.png

1 Like