Why won't Pawn spawn?


RedText
This is the player controllers script. I had this in event begin play until i realized that wasn’t being run because the player controller is already in play. then i tried to move it to the construction script, but for some reason spawn actor nodes can’t exist within the construction script, so ive tried a custom event and am currently trying custom function. but no matter what i try, its returning null when trying to spawn the pawn. the cast is just there so i can check it it spawned or not.

any ideas as to why its not working? i don’t know how much more directed i can make the testing to see whats wrong


Indeed

added a print to the pawn construction script and it says it spawned, but we are unable to reference it right afterword. why is that and how can i solve that?


negative

attempted to set the references from the other side and the spawned pawn can’t find its owner either.
same result when using get controller before the cast instead of get owner

After Further Testing, i added a delay to see if the pawn just needed time to initialize. since functions can’t hold delay i had to move it back to an event, however the issues persists with the new order of print statements reflecting the delay

tried adding an is valid node right after the spawn node. the construction script for the pawn goes off and it announces itself but immediately after, i get the returned null print.

Hey @Nomadicbrain!

You may be able to insert the following after you spawn your actor to check if there is a delay and that is the reason for failing to cast. In the below example, Timeout Timer Max is the number of seconds it’s going to keep checking. Are you spawning an actor for each player and possessing it?

I will edit my timer test to check this, thanks for the suggestion. Currently the player controller is just supposed to spawn a pawn for itself and then reference it. i haven’t set up any code for dealing with multiplayer yet.