Hey everyone,
I’m looking for some help in understanding what is happening here or what I might be doing wrong.
I have a static mesh cube, each side has a unique material with a unique material slot name.
Now what I am looking to do is, I want to change the material of the side of the cube I click on/touch.
I can mostly achieve this but am encountering an issue.
I am currently breaking a hit result on the cube based on where i touch/click, and am attempting to use the “Get Material From Face Index” where I then use the returned “Section Index” as the index to retrieve what “Material Slot” i have clicked on. (in my testing this seemed like it was consistent with the slot index, but perhaps I am wrong and have just been getting lucky by coincidense)
Then I can use "Set Material By Name“ using the returned “slot name” from the “Section Index” and it works.
However on 2 of the sides/faces (in this case). After clicking on that faces, and applying the material to the reported “section index” (used as the “slot index”). It applies the material to a different side of the cube that I did not click on. Leaving the clicked-on face in its default state.
I’m really baffled in troubleshooting this. like I mentioned the majority of the time it seems to work correctly. click on a face. that face changes to the new material.
And In this example if I randomly click the other faces of the cube, eventually one of them will have the correct relationship with the side that did not work and eventually after clicking on all sides It will eventually change all faces of the cube to the new material.
Bonus question: I can only get these hit results from a “Line Trace by Channel” node, I can not receive any results from a “Get Hit Result Under Finger By Channel” which is were i first started, and would have thought it should also be able to accomplish the same things.
Any thoughts or advice would be appreciated. maybe there is a way easier way to accomplish this.