I need a way to know when a controller possesses a pawn. Among other reasons, the ability to cast to my pawn’s class type one time - and then using that reference - is much more desirable than casting the pawn’s class throughout the entire blueprint. The problem is that the controller does not have an event that’s called once it possesses a pawn, and assuming the controller’s BeginPlay event is a valid substitute has two glaring problems.
1): BeginPlay is only useful at the start of the game. Once a pawn is destroyed, its controller has the option to not. If it doesn’t, and it possesses a new pawn, the BeginPlay event on the controller will obviously not be called again.
2): In a server-client relationship, the server’s controller will not have a pawn possessed at the time its BeginPlay event is called. This makes sense on its own, but again is a major problem when having things happen once a controller possess a pawn because the GetControlledPawn node will return null.
My workaround is to have an event dispatcher on the controller, and have it invoked off of the pawn’s Possessed event, but I feel like this should be in the engine by default. Adding this will benefit the majority of users, reduce custom code needed to be created, and help add consistently - especially when working with a server-client relationship.
Thank you for the read.