Destroy Actor NOT getting called on Client

Doesn’t matter if you are calling it from Switch Has Authority or directly from a cast from an OnComponentHit event. Print Strings ARE working though, so it is definitely something fishy with DestroyActor.

On further investigation, it appears that this has been a problem since 4.13 at least.

Once again, DestroyActor works for everything OTHER than when called on OnComponentHit on a Box Collision in this case.

Then there’s OnCollisionBeginOverlap, again with Box Collision. Simple Cast to FirstPersonProjectile, on success, it gets destroyed, but there’s a catch. On server, it happens instantly for everyone, but one client… there’s this strange delay, and I don’t have a delay on it.

Actor that is being getting destroyed has the following settings applied to it:

  • Always Relevant
  • ReplicateMovement
  • NetLoadOnClient
  • Replicates

Everything else is default.

Collisions are working. Print String are working.

Just tried Applying Damage to it and ummm…something’s not right.

Here’s the actor that is should be getting destroyed:

I even used the Component Replication stuff on everything just in case that was an issue.

Just tried Set Life Span for client, no go. Obviously I have something messed up, this is a pretty important feature that someone would have noticed by now.

One last thing, the actor IS replicating physics… but I just tried it without physics and nothing. Hoping I just missed something but who knows.

I even tried this: Screenshot - d4ce4bbc93b89cba247a52cc6f605543 - Gyazo
No go.

Hey Victor,

So I’ve just created a simple test project with an actor called DestroyActorTest. I’m going to attach my project so you can take a look at my setup and see if my repro is correct, but I’m not seeing the same issue on my end.

Go ahead and look inside of DestroyActorTest and follow that blueprint logic. Then Play in New Window with 2 players and Create a session on the server and join with the client. You should notice when you run into the cube towards the center of the map that the cube is destroyed for both the client and server at the same time.link text

Let me know if that helps or if there is anything that I’m not doing correctly on my end to reproduce the issue.

Your example only uses the Server to destroy the actor. The problem is destroying the actor with the client, which in your example (especially using OSS Steam), I can’t reliably test. But, using Play in New Window 2 Players, and hosting the server with the server window and then entering with the client, doesn’t produce another player, it is the default flying camera pawn.

I guess I’ll look at it later with my laptop to see if not having two steam clients is producing your bug.

Nope, definitely wasn’t working when I was just calling DestroyActor by itself RIGHT after a print string. Seeing how the print string went off in the respective window, you would figure the DestroyActor would get called. But it doesn’t on the client.

But yeah, yours is definitely working.

I am going to check with overlapping the player pawns in my setup to see if this is Projectile related.

If the server has authority over it an actor then only the server should have the ability to destroy said actor, since it will make sure that this actor is destroyed on every client given that it is in fact a replicated actor. What kind of actor are you trying to destroy?

If you’re getting the issue where the client is the default camera, double check that auto connect to server is off in the Advanced Settings under the play button. That should resolve that issue.

The reason that yours wasn’t working is because you’re calling a server function to call destroy. It would work if you just call destroy, and I made a mistake in my setup with including the Switch Has Authority before the DestroyActor call, so you can go ahead and get rid of that.

Glad that seems to be working. Do you need any further assistance with the issue?

Okay, now I have comments everywhere, but player pawn cast works as expected in my setup now. But projectile still doesn’t work, even after making sure the collision settings were correct. Could there be any physics/projectile movement settings I am missing out on for networking?

Okay, so check this out, so you can see the problem in action: Screen capture - 0164a0eb62b47c286dc71620796d3b73 - Gyazo going to post BP, but as you can see…if server is working…client should be tooo…especially since the stupid print string is going off correctly

So many comments all over the place now :() Anyway: here’s the BP for the DestroyActor Actor: Screenshot - 2d48263f3cf3cf5202b5d9a172e5125e - Gyazo

Here’s the Projectile: Screenshot - 5df379539bd06720da52422100a82b11 - Gyazo

Here’s the project zipped: Dropbox - File Deleted Really hoping it is just something silly I’ve overlooked, good lesson to learn :slight_smile: I’ll never forget this one.

Double check to make sure that the projectile is set to Replicate and Replicate Movement.