Hello, I have made a Minecraft like block, and I made a script to pick it up and lay it down. If you want to pick it up, you click on it and the script fires an event, that is attaching the block to the character. And if you want to lay it down, it destroys the attached actor and spawn a copy of it. But sometimes, the original is still in the hand of the character andt there are two blocks. I searched the problem, but I didn’t found it. It seems, that only the ‘Destroy Actor’ Node doesn’t fire.
to destroy actor put the float of target
Which float? Do you mean the ‘Snap to grid’? The locations are correct and it must destroy itself, but sometimes it isn’t destroying itself.
I can’t see your Blueprint, that picture is showing way too small for me.
Trust that Destroy Actor is not a bug, it works fine, so the bug is somewhere in the path to it being called.
Also, one thing I normally do with inventory items. I don’t ever put the actual same object on the character. The one in the world would fire an event or call function on the character that interacts. The character could have items that are not visible. Then make them visible and hide them not actually destroying them. It doesn’t have to be done that way, but I think it makes it easier, especially since the object in hand is just a mesh it doesn’t need any logic to it. But, the one in the world needs collisions and some events so it’s an Actor, not just a visual mesh.
@mikepurvis: Right Click the Image and open it in a new Tab to see it. It’s a forum bug.
@Christäleon: Are you sure the Cast of your “GetPlayerCharacter0” is not failing?
Did You Use Level BP or Class BP??
I’m using a class Blueprint. And ‘Get Player Character’ couldn’t fail, because the spawning and the variable change are working.
I did not say “GetPlayerCharacter” is failling. I said that the CAST is failing.
Put a PrintString after the 2 Execs of the Cast node. One for the normal upper exec and one for the “Cast Failed” exec. And check what it prints.
No, it isn’t the Casting. The Script was completely executed.