Problems with blending physics and animation

I’ve created and implemented a simulated tongue for my character using PHaT - it looks and works perfectly. I set up all other bones as Kinematic, and left the tongue bones as Simulated. I added collision bodies around the character’s face so it didn’t just clip through the jaw. I also gave fairly tight constraints so it couldn’t flip fully over / move too far.

Then, in my character blueprint, I enable Physics simulation - hit play and the tongue goes absolutely crazy. Ignoring all collision and constraints set in PHaT. It just swings all over the place.

It’s obviously reading from PHaT since it is only the tongue being simulated. Rather stumped…help appreciated.

Video of it working inside PHaT : - YouTube

Hi Kenomica,

You could try tightening the constraints up more than you have now. Sometimes they need to be much tighter than you would expect.

If that doesn’t help, have you looked through our PHaT tutorials yet? They might cover something that could help you troubleshoot the issue.

Thanks for the reply. I have used those tutorials - yes. They are a great help. That’s what’s odd though, inside PHaT, everything is perfect.

I’ve played around some more and I am experiencing very weird behaviour - I’m suspecting a bug or two. For example, settings are not being updated unless I delete the character in level and re-add it back in again. In fact, I have had several engine crashes during these issues - ones that I cannot reproduce a second time if I do the exact same steps.

I’ve found that setting the collision preset on the mesh from “character mesh” to “physics object” allows the tongue to react in the exact same was as demonstrated in PHaT - but it also causes issues with destructible mesh collision (character just walks straight through them)

Would you mind posting the .fbx file so I can take a look at it in house? You can just link me to Dropbox or if you’re not comfortable doing that you can send it by private message on the Forums.

Thank you - sadly I had some issues yesterday that caused me to lose a chunk of work. Including this character (or at least, the rigged version)

My UE4 crashes appear to have stopped - I think something happened in engine that caused instability - a few destructible meshes were being flagged as static meshes causing build crashes etc. So recreating the blueprints caused them to be flagged correctly.

My findings are odd though. Hopefully they’ll help with bug reports.

  • When using a physics asset, the character only casts shadows from within the area of physics bodies. So in my case, despite only using the tongue as a physics body (and the root bone as kinematic to stop any other simulated physics) - it was only the tongue that cast shadows.

  • Physics simulation appears wild and ignores constraints unless the object using a physics asset is set to a physics body in the collision settings

For the first issue, double check that Cast Shadows is Enabled and try toggling Cast Shadow as Two Sided to On as well.

If that doesn’t do work, could you send screenshots of the issue?

Took some screenshots to show the issue. Had to use a different mesh since I lost the rig on the Dinosaur (but the issue is exactly the same regarding shadows)

You said the dinosaur rig was lost, so we are looking at the monkey’s shadow correct? I’m guessing the physics area is his tail?

Apologies, I was in quite a rush when I posted so I didn’t explain very well.

There are no physics blending for the monkey, I purely made this to show how a physics asset can affect shadows.

As you can see on the left, if the character only has a physics body for the head, only the head casts a shadow.

With physics bodies covering the entire character, the entire character casts shadows.

Hi Kenomica,

Thank you for the feedback. I was able to reproduce this and have submitted it to our developers for review.

As a temporary workaround you can set the main light that you want to cast the shadow to Dynamic. However, be careful doing this because dynamic lights can be quite taxing.

Thanks, TJ

We use the physics asset to calculate the bounding box for skeletal meshes, to keep them as tight as possible and give you the best shadow quality. If you only have a body on the head, the bounds will be incorrect.