Rolling ball + stretch / squash in UE4

Hi,

I want to make a rolling ball, based on a third person template. I want it to roll, when it moves forward, but also to stretch and squash while jump (and rolling at the same time).
If I understand correctly, I can only export bone animation to unreal editor, so no FFD modifiers, nothing like that. I cannot use rotating texture, as ball mesh is a complex asymmetric geometry.
Also animation blending won’t help in this case, as bones are actually rotating. And if I will try to blend a rolling forward animation with a lets say not rolling stretched jump (straight up), it will be somewhat weird interpolation of the two.

Am I missing something? Is this possible to achieve desired behavior with the skeletal mesh and animation? Rolling + stretch and squash at the same time.
Please let me know your thoughts, maybe there is another way to approach this problem?

Thanks,
K

Yes just make the animation on the 3d sofware make sure to make some type of mat to distiguish if the ball is rolling and use animbp just like it is setup in tp project.

You could do the squash and stretch as a morph.

Thanks a lot! I will try both suggestions!

Because the ball is rolling you may have some problems applying morph to do squash/stretch. See how it goes. If it doesn’t work out, another idea would be do the squash/stretch using material on the ball. That is, you could make a material to change the vertex position in world z to squash the ball into the ground.

Another material-based idea to consider is using distance fields to do a “soft-body” look for the ball, see here: Distance Field Soft Bodies - Rendering - Epic Developer Community Forums

Also, if “soft-body” is interesting approach to you, you could actually do a physics soft-body simulation for the ball and let the physics engine handle the deformation of the ball. Probably the best approach for that at the moment is Nvidia’s fork of UE4 called “flex”](https://github.com/NvPhysX/UnrealEngine/tree/FleX-4.19.2).

See here for some soft-body fun in UE4 + Flex:

Hey Thanks a lot! Yes, I haven’t tried yet, but I think I will definitely have problems with static morph mask verts and rotating geo of the ball.
Currently I am trying to make a multiple bones inside a ball rotating and change overall shape of the bones by applying modifiers as overlay. But its tricky too, as mesh deformation this way creates lots of visual artifacts.

Thanks for a suggestion regarding soft body and material usage, I will definitely look into that!

Although my idea is to have something more manually controllable. Like if I increase a speed of the ball it will stretch in the direction of acceleration in a controlled way, etc.
I think with some limitations I might scroll a texture of the ball (similar to scrolling a spherical mapping in a 3d software applied to a sphere), and not the mesh itself. This way I will be able to stretch and squash it using skeletal mesh and a scrolling texture as overlay. As an idea.

Thanks a lot!

K

Yes I agree, if you “fake” the actual rolling of the ball by using a material to make it look like its rolling, then you can use morphs or skeletal animations to your heart’s content :slight_smile:

Ok, I think I’m finally figured it out. Haven’t tested it yet in UE4 though:

Apparently UE4 supports up to 4 layers of bones skin. So I can have lets say two layers of bones, one will be rotating bone and the other is stretch / squash.

link: What are the Bone Limitations in UE4? - Character & Animation - Unreal Engine Forums

So will try this now. I only need 2 influence layers for my ball to work properly. So far I think this is the most elegant solution and the least complicated one. Although I need to test a performance cost for having 2 influence layers.

Cheers

hello there , i’m looking for the same effect, did it work for you ?
thanks in advance