Actor not completely destroyed on Destroyed?

I call AActor::Destroy on an actor I made in c++ but it seems like it’s static mesh component’s collision is still left in world after actor being destroyed. issue is “solved”/avoided when removing static mesh component.

I provide project I discovered this issue in when I was playing around. It’s derived from first person example. Fire some projectiles with left mouse button and then try to walk through them when they are removed. I draw debug spheres were they were are removed to simplify testing. I get stuck when trying to walk with my pawn through removed actors. Version used is 4.6.1.

Since I couldn’t get upload file feature to work I will temporary provide a dropbox link here. Don’t ask me about name.

Hey undercover,

I was able to reproduce this in your project, but when I attempted it in a new project your code worked fine with one exception: it appears that you are not including “PhysicsEngine/PhysicsThrusterComponent.h” in your RocketProjectile.h. I’m not certain how you were able to get ThrusterComponent to work at all without it, and I’m not certain if it’s related to problem you’re seeing, but it’s only difference I can see. Can you try putting #include “PhysicsEngine/PhysicsThrusterComponent.h” in your RocketProjectile.h and building? Thanks!

I use the #include "Engine.h" instead of #include "EngineMinimal.h" for simplicity. And “Engine.h” does include “PhysicsEngine/PhysicsThrusterComponent.h”, but I guess you missed that I changed that include.

I tested to just add the “PhysicsEngine/PhysicsThrusterComponent.h” include and use the “EngineMinimal.h” header instead but error still remains.

Any update regarding this issue? Think this bug should be solved even though you may be able to work around it.

I am able to reproduce something very similar in 4.6.1. It probably still needs testing in 4.7p3.

If you:

  1. Make a BP actor with multiple static mesh actors. These need collision.
  2. Make parent (root) mesh simulate phyiscs
  3. Activate (or just verify) Auto Weld on children
  4. Destroy actor during gameplay (Something like Begin Play > Delay(5s) > Destory(self)
  5. Simulate, but pause so you can enter console command “pxvis collision” and then play

You can see that children collisions are remaining behind instead of being destroyed. Oddly enough, you cannot see this if you just use Show Collision console command.

I’ve put in a Jira ticket for this. Granted, I’m not doing a coding project, but your problem sounds very similar to what I’m seeing above.

UPDATE: I cannot reproduce this in 4.7p3. I talked to one of our Physics programmers back in Dec regarding this. Looks like it was fixed.

Sounds good. Thanks!