Input mapping context needs to be added to pawn with Tick even instead of BeginPlay to work!

I use a pawn as the controllable actor in runtime.

In the Blueprint Even Graph of the pawn, whenever I add mapping context using BeginPlay event, the pawn doesn’t move. However, when I use the tick event to assign the mapping context, it works.

I think that is a bad practice, performance-wise, and I don’t know why the BeginPlay method doesn’t work. It is as if the mapping is being removed automatically and needs to be re-assign at the beginning of each frame tick.

Upon further testing, I made the Tick event to assign the mapping context just for the first few frames of runtime then stops. After stopping, input worked just fine.

It seems that only assigning the mapping context at BeginPlay even is the problem here. Any idea?

It’s because the pawn is not possessed immediately at Begin Play (controller won’t be available). Use Event Possessed instead.
image

Thanks for explaining.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.