Announcement

Collapse
No announcement yet.

How can i get the material of the trace hit ?

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

    How can i get the material of the trace hit ?

    This is really important to me and i can't find where to do it. I don't wanna create extra meshes just to know where the object got it.

    And what is that supposed to be ?
    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	67.5 KB
ID:	1142164
    Last edited by Sahkan; 12-21-2014, 04:23 PM.
    Check out my game OldSchool Nightmare : http://www.indiedb.com/games/oldschool-nightmare

    #2
    Add a physical material you can break that from the hit results
    Free Inventory System (BP AND C++ Version): Clicky Clicky
    Player Structure System (Houses!) (BP): Pew Pew Marketplace Version: Yoink!
    Howto: Create Dragable UMG Windows: Zoom Zoom

    Comment


      #3
      Originally posted by ruohki View Post
      Add a physical material you can break that from the hit results
      I'v thought about that but i can only assign 1 physical material per object, so it doesn't help me at all.
      Check out my game OldSchool Nightmare : http://www.indiedb.com/games/oldschool-nightmare

      Comment


        #4
        I don't know if that is possible, it seems like it would make more sense either way, to construct your object from different components. In the long run you're going to have a lot more flexibility and reference ability if you use them, so many functions regarding traces and hits and overlaps already give information about components they hit. If you used components you'd be tapping into the already sufficient built in system, rather than trying to do what you're doing with materials.

        Comment


          #5
          You can get the materials array, but you cannot get which material you have hit. This means you will have to use a single material per component.

          Comment


            #6
            you can set the physical material per MATERIAL you assign you do that in the material setup since you seem to use multible materials this should be the best way to deal with
            Free Inventory System (BP AND C++ Version): Clicky Clicky
            Player Structure System (Houses!) (BP): Pew Pew Marketplace Version: Yoink!
            Howto: Create Dragable UMG Windows: Zoom Zoom

            Comment


              #7
              Thanks everyone for the advices, i ended up making multiple components for trace hits. ruohki i will check it again, probably missed something.
              Check out my game OldSchool Nightmare : http://www.indiedb.com/games/oldschool-nightmare

              Comment


                #8
                first of all Break Hit Result from LineTrace and get FaceIndex , Hit Component http://joxi.ru/Y2LjRJks9BWwdr

                then you need function Get Material from Collision Face Index http://joxi.ru/J2beK83cX9exdm
                you can get from it value (and name) of hit material, then just check all materials with the same name.
                In the end you get index of this static mesh, that you can change in the future.
                Igor, swamper, sole proprietorship

                Comment


                  #9
                  Originally posted by 6r0m View Post
                  first of all Break Hit Result from LineTrace and get FaceIndex , Hit Component http://joxi.ru/Y2LjRJks9BWwdr

                  then you need function Get Material from Collision Face Index http://joxi.ru/J2beK83cX9exdm
                  you can get from it value (and name) of hit material, then just check all materials with the same name.
                  In the end you get index of this static mesh, that you can change in the future.
                  This FaceIndex is a new thing thanks for pointing that out!
                  Check out my game OldSchool Nightmare : http://www.indiedb.com/games/oldschool-nightmare

                  Comment

                  Working...
                  X