Recently, I have ported my game projecto onto UE 4.12.3. However, I have stumbled upon what appears to be a bizarre bug:
Running the game through the editor works fine yet, if I build my project, the player no longer spawns.
It might be worth noting that the player pawn is spawned through the player controller, instead of the game mode, for project-related reasons (although I also have this bug, even if I use the game mode’s default pawn class feature)
As indicated, the game is attempting to spawn the player but it fails because the player is colliding with…something? (This does not happen on the editor).
Even if I manage to put the player start high up in the air, where it does not collide with anything, I still get the same error.
I tried to change the spawn settings to force the spawn if it it collides, and I get another weird bug:
I can’t control its movement (I can, however, use the mouse and other input to control it).
This is called on my PlayerController’s BeginPlay node.
The struct is retrieved from the game instance (because we have a character select screen). It is worth noting that I make sure the struct is never empty.
PS: I have a custom find player start, used to attribute a certain player to the same spawn point. Here’s its code:
Is it possible that you are spawning more than one of the player at a time, which is causing them to collide with each other and causing the stuck movement that you’re seeing?
It’s hard to tell what’s going on exactly just based on the screenshots. Would you be able to create a simplified test project and provide me with a Dropbox link so I can take a look at it? You can PM me the link on the forums:https://forums.unrealengine.com/member.php?160394-Sean-Flint
That went through my mind however, I added a print to my playercontroller’s BeginPlay node and another one in my game state to check how many relevant player states are in play (just to be really sure), and both indicated that there is only one.
So after spending some time looking at the project, it seems like it could be related to a null reference. Occasionally, events will take place in a slightly different order in a packaged game, which could lead to one of your references not being populated yet. What you should do is set print strings on all of your cast nodes and variables to see if they are returning any NULL values. Once you find the null value or the cast failure, you should be able to determine what the issue is in your project.
If after debugging you determine that there is a potential bug, please feel free to reopen this thread, and I’ll be glad to provide further assistance.
Hello again, that actually didn’t solve my problem. I was getting NULL values on my build’s output log because they were related to a cache variable of the actor who wasn’t spawned.