Hi all,
I currently have a material I’m working on that generates a sphere mask to dent objects when hit.
The game is first person, and when I hit an object with my melee weapon, I send the hit position and the hit normal (the angle the weapon collided at). This worked great on static props.
The problem I’m struggling to figure out is that when the object rotates, I can’t figure out how to rotate the hit normal with it. Currently if I hit an object with a downward strike it will pass a hit normal of approximately (0,0,-1) but then the indent will always face towards the ground, no matter what angle the object is at.
I’d prefer to use this method if I can figure out how to rotate the impact normal with the object; preferably in the shader, but I don’t know the right nodes or math to figure that out.
I’ve tried passing the objects rotation at the time of hit and trying to figure out how to account for the objects orientation, but can’t quite crack it.
Any help is hugely appreciated.