In UE 4.14.0, the blueprint “Find Collision UV” functions doesn’t work properly with Skeletal Meshes. While it works fine for all other objects, it returns X=0.0, Y=0.0 for any place on Epic mannequin.
How to reproduce:
Place the mannequin from UE4 starter content
In a blueprint, do MultiLineTraceForObjects —> (check for skeletal, if needed) —> Find Collision UV —> Print
Thank you for the report. I was able to reproduce this behavior and I’ve created JIRA UE-39787. Our developers will be investigating further. Follow that link to monitor the status of the bug and please feel free to vote.
Have a scenecapture2D follow your skelmesh. Set it to not capture every frame.
After damage, change the material of your skelmesh to use a UV unwrap material. If set to render out the worldposition excluding offsets, it will actually include the skinned positions since its your actual gameplay mesh.
Send event to scenecapture2d to Capture. This will push the current world positions into the UV layout. Then you can project your decal or blood splat /whatever using either a spheremask or a projection matrix. You can accumulate these into the same RT so the decals build up and they should match the skinned positions.
Set your character material back to its default. Since all the above happened in one tick, nothing changes on screen other than how you choose to use the accumulated render target.
Hope this helps.
Also a new solution seems to be on the way. Looking forward to this upcoming plugin:
This is definitely a neat workaround , but I’m concerned about the performance cost (requires two RTs and a scene capture component). It’s also a bit of a pain to set up. There’s a fair few more steps than you have covered in your explanation
DON’s Mesh painting looks cool, but If it’s just decals I guess that means you can’t get the same kind of vertex deformation stuff that Ryan has going on. It looks like it’d be great for say, a paintball game, but it’s not going to be able to simulate a piece of meat torn out of a body, or a bullet hole with an exit wound.
It’s really a shame that there isn’t any “out of the box” hitmask support in UE4. It was a pretty neat feature back in UE3, and was quite simple to set up and performed quite well.
One major limitation of Ryan’s method I’m noticing is that the UV capture doesn’t seem to work if the mesh has been rotated. Animation is ok, but if you have a character that’s spinning around or flying / swimming it seems to distort the unwrap capture really bad.
For anyone interested, make sure that your scene capture component uses absolute rotation , and not relative. However you also need to make sure to include any relative offsets that have been applied to the mesh. i.e If your mesh is yawed -90 , your attached scene capture should include this as a world rotation offset! This also goes for any scaling or translation your mesh has applied!
Any news on this? I know Ryan has a workaround: http://shaderbits.com/blog/uv-dilation
I thank him so much for his work and this might stay my permanent solution, yet I’d love to see the bug fixed or have a more elegant solution, something like “find nearest UV from world position”.
I found this way as only solution for making wound system for example - I read whole possible documentation. Now looks like this is no more available. So what alternative for dynamic painting on skeletal meshes?
Yes, this is only I know about render hits on skeletal meshes. I have assets, I read tutorials but this all not works now and I don’t know other way how to do it, however possible - look DoN plugin. No problem with painting on static meshes, but on skeletal looks like a mission impossible.
It does work, but it requires some additional work to be functional. Ryan’s concept is sound, but his shaderbits demo has a number of issues that you will have to correct. One of the largest of these is that the hitmask painting only works at the world origin (0,0,0). You will need to adapt the materials to deal in local space.
For a run down of this issue see my comment on his video here :
Thank’s @AJQuick. I read your comment before and others too. I tried in 0,0,0 and translate vector to local space, but problem is, all this solutions are based on Find Collision UV what not working more with skeletal meshes. It works perfect with static meshes. I’m sure I miss something. My best result is random position paint on mesh when I get from hit impact normal