Announcement

Collapse
No announcement yet.

Linetrace Hit Same Object / Component More than Once

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

    Linetrace Hit Same Object / Component More than Once

    So I want to do a line trace against an object and get multiple hits on that object. I am doing this with a complex trace. How I would want this to work would be something like this:

    ----x[ ]----x[ ]----->

    Where the dashes are the line trace, the x's are hits and the brackets represent part of the mesh. My thought on how to accomplish this would be to do one line trace, then at the hit location of that line trace do another one. However, this leads to initial overlap issues, which I'm not entirely sure how to ignore.

    Multi line trace is out of the question, since it only works once for each object / component

    #2
    Use MultiTrace with Overlap
    https://www.casualdistractiongames.com

    Comment


      #3
      Originally posted by OptimisticMonkey View Post
      Use MultiTrace with Overlap
      Unfortunately, like I said in the OP, once a multi line trace hits an object, it ignores it for the rest of the trace, meaning an object can only appear once in the trace’s outputted hits, which is not what I want.

      Comment


        #4
        Are you trying to register hits on different parts of the same object at the same time, or are you trying to repeat the same trace multiple times hitting the same object? Total newb here, but if you are trying to hit multiple components on the same object maybe you could build the object with the construction node. Use multiple meshes with an actor "tag". This would atleast let you pick out specific pieces you are hitting. Or if you don't need the individual components maybe you could just store the hit object in an array and then do things twice to the object hit. So you are not actually hitting the object twice. You are hitting the object then doing things to the object twice.

        Comment


          #5
          Originally posted by BlueSpud View Post

          Unfortunately, like I said in the OP, once a multi line trace hits an object, it ignores it for the rest of the trace, meaning an object can only appear once in the trace’s outputted hits, which is not what I want.
          Are you certain it ignores that object for multiple hits when you have that objects trace collision set to OVERLAP and not BLOCK?
          https://www.casualdistractiongames.com

          Comment


            #6
            Originally posted by xpgained View Post
            Are you trying to register hits on different parts of the same object at the same time, or are you trying to repeat the same trace multiple times hitting the same object? Total newb here, but if you are trying to hit multiple components on the same object maybe you could build the object with the construction node. Use multiple meshes with an actor "tag". This would atleast let you pick out specific pieces you are hitting. Or if you don't need the individual components maybe you could just store the hit object in an array and then do things twice to the object hit. So you are not actually hitting the object twice. You are hitting the object then doing things to the object twice.
            When I said object, I should have said static mesh component. If you build a mesh out of multiple static mesh components, the line trace will hit each component for a maximum of 1 time. What I want is to have one component and hit it a max of n times.

            Originally posted by OptimisticMonkey View Post

            Are you certain it ignores that object for multiple hits when you have that objects trace collision set to OVERLAP and not BLOCK?
            It hits the component once, even if it's set to overlap. Like I said, I should have been more precise and said component rather than object.

            Comment


              #7
              Use a linetrace and on hit, and for loop, draw a new linetrace starting from the hit point and ending at old intended end point. Break loop on no hit.

              Comment

              Working...
              X