Download

Pawn doesn't exist on the client when called from OnPossess on the server

Im trying to run some setup code on the owning client of a controller when a pawn is first attached to the controller. As the docs say, OnPossess only runs on the server. I need the owning client to know when a pawn is attached so it can setup some client side stuff. However when I call my custom event “Setup Owner”, the pawn doesn’t exist yet on the client, since it was just spawned on the server and hasn’t been replicated to the owning client yet. I verified that the pawn does exist on the server, but not the client at the moment it runs “Setup Owner” on the client. Is there a way to initialize client side stuff on a newly possessed pawn? Or is there a work around I need to do?

Apparently this can be used if you override it. Not sure if it’s exposed to blueprint though

Yea, I came across that before too. Unfortunately that runs on the pawn, not the controller. I tested it anyway to see if I can work with it, and it runs before its assigned the controller. Using OnPossess on the pawn and using that to call my setup functions on the controller seems to work, but seems kinda messy