How to get input for a actor in unreal 5.1?

Hi,

Unreal 5.1 now uses enhanced input system to handle its input, but that only works for playercontroller. And the old input action system in the project setting is deprecated. I wonder if there is still a way to allow actors to receive input events without a playercontroller?

Hey @JimLi_2022!

You should be able to add whatever actor you need, you will just need to set up your input mapping contexts. For example, this is on a static mesh actor:

Check out this great non-Epic affiliated tutorial on setting up those mapping and how to use them:

I hope the above is the solution you need!

1 Like

Hi,

I can get the IA_Jump action node from any actor but it looks like the action will only be triggered for playercontroller(the print string node in the below image can not be called). And do you know how to add input mapping context to an actor? It seems like there is no such a node to do so:

Hey @JimLi_2022!

After doing some digging, it looks like you can enable input on your actor, which will allow all enhanced input mappings to work, however, that would still require a player controller of some sort to be active. I haven’t found yet a workaround for this unfortunately, but maybe another community member already has!

UnrealEditor_qDbNuTmKlJ

I hope that this helps.

2 Likes

you just need 2 action.

  1. in your actor blueprint , click actor name and change auto recieve input property disable to player0.
  2. make enhanced key event
1 Like

To summarize, add the mapping contex to your player controller like so.

Then in your actor, make sure to enable input. Now you can use the new enhanced input like so

Hi @DarkGate4 ,

I tried what you said and I don’t see the event firing in the vehicle Actor. I do see it firing in the Pawn.

In my Player Controller:

In my Pawn:

image

In my vehicle Actor (ViperChaos):

image

Also, the vehicle is a skeletal mesh type Actor, not static mesh Actor.

Should this work? Did you get it to work for an Actor while a Pawn was possessed by the Controller?

EDIT:

I created the most simplistic project in UE 5.3.2, a simple Pawn and a simple Actor. I got this to work. So now I have to go back and figure out what is different with this test project and the one I was trying to get it to work on.

In answer to my last question above, yes, I can trigger the event in the Pawn, the Actor, and even in the Player Controller - one event played out in all three Blueprints. (There is no need to possess any Actor to make this work.)

EDIT:

One more thing I found, in the project that it fails with, I tried a Static Mesh Actor, and it works in that. So the vehicle (ViperChaos) being a Skeletal Mesh Actor may have something to do with the failure to receive inputs. I noticed it has at the Self level of the BP the Pawn properties in the Details window. This also has the Chaos Vehicle component in it.

image

I will keep looking, but any insight would be helpful.

It appears that the Wheeled Vehicle Pawn (an Actor) does not receive input events shared by a Character Pawn.

I created a new Wheeled Vehicle Pawn, added just the test fragments and a sphere mesh, and it failed.

Any insight would be much appreciated.