Announcement

Collapse
No announcement yet.

Victory after the destruction of blocks

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

    Victory after the destruction of blocks

    Hi!
    I need to finish the level by destroying all the blocks. How do I do this? I used to make blocks spawn, but now I put them myself.

    I tried to make it so that when destroying one block, I have a counter variable that will be subtracted by one when destroying it (I did this in block bluprint). But the problem is that each block does this operation for itself, and in the end all blocks have their own variable that is subtracted once. But I need that for each destroyed block, the variable takes away not 1, but 2, 3, and so on.

    Or it is can do it another way, but how?
    Attached Files

    #2
    You can do it like this:

    Click image for larger version  Name:	Annotation-20200409-150332.png Views:	1 Size:	144.7 KB ID:	1743340

    You can do it in any blueprint outside of the block you're destroying. Use ++ or --, whichever you find more logical. The red event node will be called every time an actor receives a Destroy call. There's no need to count anything inside the actor being destroyed; that's unless it must know it for some reason, which is unlikely - it's getting destroyed anyway...

    note1: you do not need to SET a variable after ++/--, those nodes set values by reference already.
    note2: in your example, if you call Destroy and then try to do another thing after, it will not work - the object is being destroyed
    Last edited by Everynone; 04-09-2020, 10:09 AM.

    Comment


      #3
      When should the blocks be removed? What must happen for the block to be removed. The character touches the block and is it removed?
      There are many solutions.
      Or did you just finish the level and you want to remove all blocks from it?

      A block can be called by a character or other element and then you destroy it. Collision.

      Comment


        #4
        Originally posted by Everynone View Post
        You can do it like this:

        Click image for larger version

Name:	Annotation-20200409-150332.png
Views:	45
Size:	144.7 KB
ID:	1743340

        You can do it in any blueprint outside of the block you're destroying. Use ++ or --, whichever you find more logical. The red event node will be called every time an actor receives a Destroy call. There's no need to count anything inside the actor being destroyed; that's unless it must know it for some reason, which is unlikely - it's getting destroyed anyway...

        note1: you do not need to SET a veritable after ++/--, those nodes set values by reference already.
        note2: in your example, if you call Destroy and then try to do another thing after, it will not work - the object is being destroyed
        I am very grateful to you! I asked this question many times but could not implement the tips!
        You will not believe it, but with this easy problem I suffered for a week, but now I can go further ​​​​​​​

        Comment

        Working...
        X