Announcement

Collapse
No announcement yet.

Multi Sphere trace detecting same actor more than once?

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

    Multi Sphere trace detecting same actor more than once?

    I have 4 enemies around me, and when I press a key the code is meant to multisphere, find these 4 enemies and add them to a array. Somehow, each one of them is being added more than once, as I print the length and it returns 3 times more the number of enemies.

    Product Version: UE 4.9
    If you want to see my UDK games, have a look at my website!

    #2
    How about a Check if the Actor is already in the Array before adding him.

    Comment


      #3
      Maybe a ForLoop after the trace with a print string can tell you what you are hitting each time, then you can narrow it down. I had this problem not too long ago with a character of mine returning almost every part on it as a hit. I ended up setting all the extra body parts to the NoCollision preset and having collision turned on for just the CapsuleComponent. Solved my problem thanks to help from here.

      Click image for larger version

Name:	Possibility.jpg
Views:	1
Size:	113.2 KB
ID:	1102903

      I could be wrong on how the print string would work there, but something along those lines seems like the way to find the issue.

      Comment


        #4
        Originally posted by Relic1882 View Post
        Maybe a ForLoop after the trace with a print string can tell you what you are hitting each time, then you can narrow it down. I had this problem not too long ago with a character of mine returning almost every part on it as a hit. I ended up setting all the extra body parts to the NoCollision preset and having collision turned on for just the CapsuleComponent. Solved my problem thanks to help from here.

        [ATTACH=CONFIG]84769[/ATTACH]

        I could be wrong on how the print string would work there, but something along those lines seems like the way to find the issue.
        For the past 2 hours I've been fiddling around with a duplicate BP and it seems the collisions I have inside of my Enemy are detected as an object as well? I can confirm this as when I delete them only 1 object is detected.
        If you want to see my UDK games, have a look at my website!

        Comment


          #5
          Originally posted by KenshiHH View Post
          How about a Check if the Actor is already in the Array before adding him.
          It seems the problem is the collisions inside my Enemy, they are considered as an extra enemy for some reason... have been looking at the differences between a collision of a different enemy that has a collision but is not recognized in the sphere trace and my current enemys collisions and they have exactly the same boxes ticked. Still wondering what I'm doing wrong. Tried to add the collisions to actors to ignore, but collisions are not actors...
          If you want to see my UDK games, have a look at my website!

          Comment


            #6
            When I had my problem, my line trace was detecting all the different components in my character. I printed the results to the screen and ended up with this:

            Click image for larger version

Name:	CollisionResults.png
Views:	2
Size:	712.4 KB
ID:	1102910

            So what I ended up doing was setting all of the extra components to NoCollision under the presets for collision, and the capsule component was set to Pawn and Mesh was set to CharacterMesh. I also made sure that the component tree was in the right order. It worked fine after that. I only get 1 collision now when tracing it.

            Comment


              #7
              Originally posted by Relic1882 View Post
              When I had my problem, my line trace was detecting all the different components in my character. I printed the results to the screen and ended up with this:

              [ATTACH=CONFIG]84776[/ATTACH]

              So what I ended up doing was setting all of the extra components to NoCollision under the presets for collision, and the capsule component was set to Pawn and Mesh was set to CharacterMesh. I also made sure that the component tree was in the right order. It worked fine after that. I only get 1 collision now when tracing it.
              The issue is that I need those collisions to be active, however I managed to discover that spawning them inside your character instead fixes the issue. Thanks anyway.
              If you want to see my UDK games, have a look at my website!

              Comment


                #8
                Glad you fixed it. Good luck!

                Comment


                  #9
                  Originally posted by Relic1882 View Post
                  Glad you fixed it. Good luck!
                  Many thanks!
                  If you want to see my UDK games, have a look at my website!

                  Comment


                    #10
                    Pls help me im having the exact same problem, what do you mean by "spawning them inside your character instead fixes the issue."

                    Comment

                    Working...
                    X