Download

Cast to PlayerController -> Cast Failed, but everything works?

Hello forum!

So I’ve been struggling with this blueprint for a while, as I’m still new to the visual scripting.
I made a basic mesh in which the user can press ‘E’ to trigger a timeline, using a trigger volume, however on the event which triggers when the player enters the trigger volume, I’m casting ‘Other Actor’ to PlayerController.
When debugging this, I can see that the ‘Cast Failed’ is being triggered. How is that so?

Quick note: everything works just fine, though ‘Cast Failed’ is triggered???

Blueprint
9953139797076d75ff162eb20cde77f44db7783d.jpeg

Because “other actor” is never PlayerController, i think player controller does not even exist in 3d space.

Other actor is reference to actor that player pawn collided with.
EDit: well it depends where you trigger “on component overlap” event, if you trigger it on some component other than player pawn, it will (sometimes) get reference to player PAWN (never to player controller).

To check type of actor drag that blue pin out and type “==”, then you can compare classes.

And you do not need cast to player controller here at all, that is why it is all working.

So the ‘Cast To PlayerController’ isn’t necessary at all? Can I just enable input without having the player controller?

EDIT:
Never mind, I just read my own Blueprint and I guess I got confused somewhere i the process, as I already have the player controller with the ‘Get Player Controller’ node. Thanks for the tip though.