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.
Announcement
Collapse
No announcement yet.
'Destroy Actor' doesn't work
Collapse
X
-
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.
Comment
-
@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? :POpen for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR
My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
(Including 100+ Pages Multiplayer Network Compendium to get you started.)
Comment
-
Originally posted by Christäleon View PostI'm using a class Blueprint. And 'Get Player Character' couldn't fail, because the spawning and the variable change are working.
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.Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR
My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
(Including 100+ Pages Multiplayer Network Compendium to get you started.)
Comment
Comment