Need help with a tutorial : TopDownCharacter VS Player Controller

I haven’t watched anything you posted. But based on the answer I can give you a bit of context.

One of the simple way I can think of to describe “cast to” would be the following: you get a reference to an object (in your case the blue pin “other actor”) and you try to check if it’s an object of the class you’re casting to. If it is, you’ll be able to manipulate it and any property it has.

So basically when you try to “cast to player controller” out of the “other actor” pin of a collision event (let’s say overlap) you’re basically saying “whatever collided with me, I try to know if it’s a controller”.

But Controllers have no physical presence whatsoever, they can’t collide with anything. Your controller will never fire this event and therefore your cast will never be successful.

What you want to do is find the reference to the player controller where you coded your item logic. Where will you find such a reference? Well, this controller is logically possessing the character used to step on the item.

In this case it’s pretty easy, you just have to grab the wire out of the “other actor” node in your collision event. Cast it into your class of PlayerCharacter then grab the pin out of the cast, get the controller out of your character and cast it into your class of PlayerController. The blue pin out of the cast will give you a reference to your PlayerController.

The logic of this is the following: an object collide with the item, is the object my player character? ok, yes, then I grab the Controller of this character and I try to see if it’s my type of Controller. If it is, I can access and modify its properties.

Quote me if you want more details (it will give me a notify).