Hmm… Not sure what to tell you.
Yeah its weird because everything is the same as in the tutorial yet it doesnt work
Make sure on your BP, auto input is set to player 0 in the details panel.
Just changed that unfortunately it didnt fix it
Right click on your spawn actor node and add a breakpoint, then when you test it, see if the breakpoint is hit. If the breakpoint is hit, it should pause the game and show you the spawn actor node.
Thanks for the help by the way. It does not hit the breakpoint. I think the event is not being triggered at all…
It stops hitting the breaking point at the bind event on destroyed
You are binding onDestroyed, but you are never calling it.
Where should i call it? i’m kinda new to the unreal engine 4
Well, it looks like when flying pawn is destroyed, it will spawn a new one, is your pawn being destroyed?
Oh in that way. Yeah i made this basic thing for when it hits something it gets destroyed
So it destroys it but never spawns another?
Yeah pretty much. Whenever i hit something it dissapears and shows the smoke and explosion. But it never creates a new one
Hmm… Why do you apply damage if you remove it manually?
For the structures around it to break. They wouldnt break if i removed it manually
Hmm… I’ve never bound events, so I’m not sure I can be of further help.
Here is what I think is the issue. Inside your game mode, you try to bind an event to the player’s character but the player’s character is not necessarily initialized before the game mode’s BeginPlay is executed. Try adding a delay node after BeginPlay to verify. If it does work then, then you know the order of initialization is the issue.
If so I would suggest moving the respawn logic over to the pawn blueprint’s Event Possessed or some other event that assures you that the pawn is initialized and possessed by the player controller.
Ive added the delay. But its still not working. The Cast to FlyingPawn is triggered but the Bind Event to onDestroyed wont be triggered. Ive got no idea how to fix this
Okay for anyone interested ive made a workaround which is useful in my game. This way the player gets control of a new spawned pawn after a set amount of time. I will have to fix this later on but ive been stuck on the respawn for 2 days so im moving on with other features.
Heres the blueprint:
Did you try the bp respawning tutorial on the wiki?
Thanks TheFoyer the multiplayer blueprint helped fix it! it took me some time to figure it out but it works perfectly.
Oh and do i have to close thread now or something?