Spawning an actor in C++ on a client causes crash
I'm trying to spawn a local actor on the client that doesn't replicate. I'm using GetWorld()->SpawnActor, but it crashes in PostSpawnInitialize at check(Role == ROLE_Authority) with this error: Assertion failed: Role == ROLE_Authority.
asked Apr 09 '18 at 03:53 PM in C++ Programming
Looking into the code within PostSpawnInitialize it appears that the check is making sure that the local machine has the proper flags set to have authority over the spawned actor.
If you're spawning an actor locally on a machine then you need to set its Role to ROLE_Authority to signify that it can be modified by the local machine.
This variable is by default set to ROLE_Authority, but its possible that the spawn parameters could be changing this.
answered Apr 09 '18 at 04:23 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here