How do I setup shadows for animated meshes?

Hi all,

I am trying to import a skeletal mesh with animations into my scene. The animation consists of a pair of feet walking back and forth. When I place the animation in the scene and simulate the scene, as the feet get further away from the initial position (this happens as the animation plays, I am not translating the feet) then the shadow disappears. However when I playback the animation in Persona there’s a shadow even when the feet move far away from the initial position which is what I want to happen in my scene too. I am using the third person game template for this and I haven’t modified the lighting or the ground except a texture for the ground. What could I do to fix this ?

Many thanks !

Cheers,
Shailen

The solution to this problem ( many thanks to Mehmet Guven for the tip ) is to create a physics asset while importing the FBX file. I was earlier unchecking the creating of physics asset during importing it and it was causing this artifact.

Hi everyone!

You discovered the solution before I could get to this. Yes, if an actor goes outside of its Bounds, then material/lighting issues can occur. SkeletalMesh bounds are governed by its physics assets.

Good job!

The most game-engine friendly way to set up animations is to

  • remove all root translation from the animation, keeping all other aspects of the animation
  • move the skel mesh actor yourself during game time at the appropriate speed

this will fix your shadow issue

and many other potential future issues

Yes there might be a simple fix for your immediate issue

but in the long run you should consider avoiding root motion

root motion might very well be not be fully developed to work in UE4 yet ( I dont know)

but even if it does work

root motion is always complicated.

you have no need of such complexity

consider redesigning the animation and moving the actor yourself via unreal engine :slight_smile:

Rama

The thing is that the animation I am trying to display here is the reference motion capture data which I will be using as “ground truth”. I don’t want to modify the animation for two reasons

  1. Root motion is unknown
  2. I want it to be untouched because this will be used to compare against procedurally generated motions. If I modify it in certain ways (remove the root motion from the motion capture sequence, if its possible at all, and then add the root translation to it later in UE4) it looses the credibility of being the ground truth motion.

I do understand the fact that animations in games should ideally not have root translation but then this is not for a game. Now given this information is there a way to fix the shadows for this animation ?

Many thanks for taking time to explain your answer to me though :slight_smile:

Can it be a problem with Physics Asset?

Actually I have not created a Physics Asset. I am just placing the animation node into the scene to visualize it. I turned off creation of Physics Asset during importing the fbx into the scene. Is there any other way I can place it in the scene since all I want from this animation is to play in a loop when I click on a checkbox or something.

Why don’t you create a Physics Asset for it and give it a try? It won’t affect anything if all you want is to see the animation playing.

I just tried it and it worked ! Does creation of a Physics Asset change the way lighting is applied to an asset ?

I don’t have full knowledge on Physics Asset’s effect on lighting but i’ve heard of people having this issue before. This is from Vehicle Tutorial on UDN;

Depending on the shape of the vehicle, you may need to add some tiny physics objects within the wheels (attached to the joints you’ll be moving with the animation blueprint). This is because bounds for a skeletal mesh are calculated based on its physics shapes, and you can get odd shadow clipping and other rendering errors if you don’t correct for this.

Glad that it works now. :slight_smile:

Ah I see. Many thanks for you help ! Really appreciate it !