Announcement

Collapse
No announcement yet.

Help: Destroying Spawned #d Widget BP

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

    Help: Destroying Spawned #d Widget BP

    Hi

    I have an array where I run a for loop to generate 3D widgets in game.

    They spawn great.

    Tried this to delete them, but only 3 destroy. Also tried a manual array index. No luck

    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	42.9 KB
ID:	1143955

    Any ideas?

    Narg


    * Edit, I know false and true are connected, did it as a double check for errors.
    http://www.seven-mountains.eu/


    #2
    How many elements are in your stock array?

    Comment


      #3
      5

      Regards

      Narg
      http://www.seven-mountains.eu/

      Comment


        #4
        Well, it is trying to destroy the one at that specific index, but there will only be a 3d widget at that index for the first 3. It's running get all actors of class each time, and making a new array, numbered 0 to whatever.

        So what I think is happening, is that after the one at 0 is destroyed, the indices 0,1,2,3 remain, then you destroy 1, and 0,1,2 remain, then you destroy 2, and it's 0,1 left. So the last two are never destroyed. When you spawn those 3d widgets, add them to an array, so you will be able to refernece them without using get all actors of class.

        Also, you don't need to cast before destroying them

        Comment


          #5
          I think you have hit on it. Made it reference 0 and 4 were destroyed.

          Just got to get rid on the last one now.

          A little head scratching.

          Narg
          http://www.seven-mountains.eu/

          Comment


            #6
            How are you spawning them?

            Comment


              #7
              Got it

              Thanks again Mosel3y

              Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	46.8 KB
ID:	1066211

              Narg

              *edit: it works, but shortened it too much. need to put some nodes back in or I get this error.

              Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	94.9 KB
ID:	1066214
              Last edited by Narghile; 02-09-2015, 10:29 AM.
              http://www.seven-mountains.eu/

              Comment

              Working...
              X