Announcement

Collapse
No announcement yet.

'Destroy Actor' doesn't work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    'Destroy Actor' doesn't work

    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.
    Attached Files

    #2
    to destroy actor put the float of target

    Comment


      #3
      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.

      Comment


        #4
        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


          #5
          @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? :P
          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


            #6
            Did You Use Level BP or Class BP??

            Comment


              #7
              I'm using a class Blueprint. And 'Get Player Character' couldn't fail, because the spawning and the variable change are working.

              Comment


                #8
                Originally posted by Christäleon View Post
                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.
                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


                  #9
                  No, it isn't the Casting. The Script was completely executed.

                  Comment

                  Working...
                  X