Error on SpawnActor: Failed to Route BeginPlay
Got a really confusing bug here. I have a class named "AItemActor", that derives actor. I have a function in a class called ActorManager that is responsible for spawning these. The rough process is: character performs an action, the character class then calls an RPC function to the server, passing the blueprint path of the item they want to spawn, server spawns it, and the actor is replicated. I get an error thrown immediately when the actor is spawned:
If I hit f5 and ignore this, the actor does actually spawn fine, and I can continue with no problems. The next time an actor is spawned there is no problem at all, even when I end the session and restart. The bug only remanifests when I close the editor and start over. Obviously this error is thrown in the packaged version of the game too, and crashes it immediately with a fatal error.
The code and the rough steps are outlined below:
User presses a button. A function on the character class fires, leading to the following:
This functions implementation makes a call that looks somewhat like this:
"ActorBlueprint" is of type
The function then looks like this:
This is the line that throws the above mentioned error. It will only happen the first time the call is made, and all pointers are valid and not null.
The following code is how I am loading the item itself, incase the loading of the blueprint isn't quite correct:
Any help would be hugely appreciated. Is this a replication error? Is there a better way for me to load items, instead of using paths?
asked Jul 21 '18 at 10:28 PM in C++ Programming
AItemActor must have forgotten to call Super::BeginPlay()
answered Jan 09 '19 at 12:12 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here