Does anybody know a good way to dynamically apply damage to a character so the texture shows blood on impact? I’m developing a sword fighting game and I would like to show cuts where the sword hit the enemy.
I tried with decals but with human characters you get a lot of “texture swimming” depending on the hit location.
[QUOTE=Wilkes;694426]
Ryan Brucks got it to work somehow:
Amazing! Thanks I will take a look and try to understand how he did it. I took a quick look and I did not find how he transforms the hit location to UV position, but he is clearly doing it somehow…
I was able to follow Ryan Brucks’ tutorial to encode local positions to a render target, but I’m not able to apply the damage texture so it can be rendered to the render target.
This is the material I use to paint the damage based on hit position:
But when I use this material to Draw Material to Render Target (or when I set the view port to render the material on a plane) it comes back pitch black:
@jawatr - Just in case you’re still stuck on this, I’m pretty sure your issue is with local bounds calculation.
In your viewport everything works because the material has access to your character’s local bounds (via the ObjectLocalBounds node). But when you’re drawing this material to a render target the node will return nothing because it’s really just an additive brush material.
One way to solve this is to add two vector parameters - min bounds / max bounds and feed these values in from your blueprint for each mesh. You can go one step further by using the same parameter setup while generating your positions texture too, thus ensuring consistency across the board.
**A Plug for my plug-in:**
If you're looking for a single-node painting solution that works on any number of characters/landscapes/props, is network-ready and supports collisions, then do check out my mesh painting plugin :)
https://youtube.com/watch?v=MXrHfWu9vD0