Actor component reference from Player Character Object reference variable

I was following a tutorial for creating a crafting and inventory system. The tutorial was in UE4 and I’m using UE5, everything until this point was identical. Here in the tut, they are able to get a actor component reference from a PLayer character object reference variable, whereas I’m unable to do so in UE5.


You can’t just join them together. You have to pull from the player ref, and search for the inventory component.

Also, I’ll preempt this, the player ref actually needs to be pointing at your player. Having the right type of variable is not enough.

Unable to pull a Inventory component from player ref in UE5, thats how they did it in UE4 though

Is the player ref variable of the right type? ( is it the type of your player? )

Yup

I just put an actor component in the first person character. Then, in a widget, I can

and if I put a map in that component

Thanks a lot. The issue was that I never added the Inventory component to my Character.
Now Im able to directly cast to the map from the Obj Ref variable itself.

2 Likes