Destroyed Actors Still in Outline. Creating unwanted behaviour?

[Video demonstration of issue. Skip to 1:40 for gameplay][1]

So I have a game were you can control two pawns independently using WASD and the arrow keys. There movement is based around “platforms” which are actors. I have it set up so that

The actor should be able to move to any adjacent platform that doesn’t have the other pawn on it. I’m doing this through GetAllActorsOfClass (platform) in conjunction with GetAttatchedActors to get a return of None, and checking if there is a pawn attached to it. The game has a bunch of points that when the pawn collides with they are

and then reattached to a platform has no attached actors. I’ve found some unwanted behaviour that allows the pawn to attach itself to a platform when the second pawn is already there.

I think I have found the source of the problem when I

. After destroying the actor sometimes it will print that there is still an actor attached to the platform which is messing up the logic that makes sure that the platform is a valid platform to move to. The actor is gone and destroyed in the game world by the game still prints that there is an attached actor. In the world outliner there is a build up of "

241153-delactors.jpg

" and I think this is whats causing the issue. As there are “ghosts” destroyed points that are messing up the checks. As far as I can tell my blueprint logic is sound and I don’t know how to deal with these ghost points.

I had something similar. My issue was that actors are not destroyed immediately, so the moment you destroy an actor is not the moment it actually gets destroyed. In my case, I had an array where the actor was referenced, so the fix was rather easy - I removed the actor from the array immediately, then destroy it.

Also I don’t think using Get All Actors of Class is necessarily the solution to check for movement, I would rather linetrace towards the direction you want to move towards to see if there is anything there to block the movement. If you added something to check against on the platforms themselves, you could also make changes to the playing field very easily.

I couldn’t figure out what was causing the ghosting so I ended up changing the movement system to using a line trace like you suggested. Its no longer affects gameplay.