Download

How to Re-Scale a Ball that rotate from Physic

I try to re-scale a ball on a break event that has a rotation from physics to gave a squeeze effect. Since the orientation of the ball is changing I want to apply the re-scale according to the floor. The only way I found so far is to reset the rotation to zero and then apply a re-scale on Z. But that method is not very nice visually; I would like to have it more dynamic according to the rotation of the ball.

How can I do that better?

https://youtu.be/wPl0gPj6daU

I try this modification but still out of luck:

That the effect:

Hi, scaling objects do not respect the matrices of parents or children. At least there is no shearing in ue4. What you can do instead is use material’s WPO (world position offset) to squash the vertices in the same manner. I’ve built an example for you here:

Please note this will not update the collision of your sphere


edit: the comment “multiply the offset for squash. (values 0 - 1)” you can multiply under 0 and it will stretch the sphere in that direction rather than squash.


You can change the squash direction by updating the squashNormal variable. Best case I can think of for now is to use the sphere’s collision normal whenever it hits something.


getting collisions to work is going to be another exploration. What you could try is adding a sphere collision as the parent of this sphere, turning on setAboluteRotation node with event beginPlay, scaling it to match the intended squash of your mesh. I don’t now anything about this part… so Good Luck!

1 Like

I will need to investigate that approach i.e using the material to squeeze a mesh.

Thanks !