Here are a few errors I stumbled across, I want players to be able to damage eachother. I have set it all up, just a few problems left. This script makes my characters die, but they don’t dissapear: Screenshot - 9a79c11c166818a14d7f410252ab575e - Gyazo
For the first one you are calling the cast to after the execution of the destroy actor so it doesn’t technically know what actor to destroy when the destroy actor is called and the cast requires an object to cast from as well as to. Instead of using cast to just leave it as destroy actor with self as the target like this:
For the second one you need to swap the location of the destroy actor because as you have it the destroy actor will fire if health is greater than the blank Compare With value you have entered…you may also want to replace the compare float with something like this for both of the checks you have setup:
Here if health is less than or equal to 0 it will return true otherwise it will return false.
Thanks! This fixed some of the issues but not all, both client and server can die now. But the blueprint is in the bullet, thats the catch. So if I target destory actor as “self” it only destroys the bullet, any idea on that?
Also make sure you have a default value set for Health to your 90 value that you mentioned earlier. This is how it should be in your BP I skipped the add to viewport stuff but that can still be done if you are needing that:
Everything works! Some of my replies dissapeared for some reason, the problem right now is that the client/Player 1 dies, but the server says “Dead” but the actor doesn’t get destroyed. Player 2 get destroyed though
The setup should be the same, a weird thing is that when I run a dedicated server none of the actors get destroyed. When I play on a non-dedicated server, Player 2 can die. I am quite weirded out by this