Announcement

Collapse
No announcement yet.

How can i get the material of the trace hit ?

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

  • replied
    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!

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    Thanks everyone for the advices, i ended up making multiple components for trace hits. ruohki i will check it again, probably missed something.

    Leave a comment:


  • replied
    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

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    Add a physical material you can break that from the hit results

    Leave a comment:


  • started a topic How can i get the material of the trace hit ?

    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.
Working...
X