Input Component not present on my defaultPawn_BP

As soon as i use the “if (InputComponent)” statement to run my grab and release code block it doesn’t work. So i tried logging out:

if (!InputComponent)
UE_LOG(LogTemp, Warning, TEXT(“input component is not present
on %s”), *GetOwner -> GetName)

to see if the input component is actually present. The code within the if statement ran after compiling and to double check i ejected from the DefaultPawn_BP and selected it in the world outliner to see its properties. The Input component was not present, in the lectures i learnt the input components were meant to be added automatically to my blueprints. I’ve tried manually adding the input component but its not even appearing when i search under +AddComponent. Please what can i do?

On later version’s it’s just not listed anymore. It’s still there however, all actors have it

Are you sure you’re playing in editor and not simulating? The instance of the input component is created when spawned/begin play when a player is possessing, if you’re simulating then a player isn’t possessing so the input component isn’t created.

Input component is not there when i play/simulate. But the input bindings for Grab() and Release() work. Since you said its not visible in new unreal updates, then its fine

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

Privacy & Terms