Hi, I am trying to get a material to squash into a hit point. I have no trouble passing hit and normal information to the material but I am having a problem moving the pixels toward the hit point along the normal. I also want to push the pixels toward the hit point but not have them go beyond a “floor”. The attached picture shows what I would like to happen.
Between 5 and 10 is a good amount to get a noticable effect
The vector needs to be specified local to the ball. So, for instance, shrinking on Z, is the ball’s Z, not world Z. It also works regardless of ball orientation.
Thank you @ClockworkOcean , this is an awesome start. The only thing it needs is to squash into the hit location. The example you show squashes into the middle of the sphere. If I multiply the normal by the sphere’s radius, I think I can subtract that from the World position to reposition the sphere to squash into the hit location. I will attempt it this evening and report back here.
On hit, the ball blueprint sends a hit normal and then plays a timeline which adjusts the “Amount” parameter. In the material, The translationMax parameter is based on the size of the ball.
How I’d like to improve this:
I’d like to stretch on a perpendicular plane. So for example, if the squash happens in the Z plane, I’d like to stretch the material a bit in the X and Y planes. This is difficult because I don’t really know how to create perpendicular planes, let alone stretch them if I did!
The timeline needs to be tweaked but I think that is achievable.
I like the look of Clockwork’s squash better than mine, but I just couldn’t get it to work with translation. if I could…
The nice thing about this approach is that the ball can rotate and the squash can happen in the direction I need it to while rotating; the squash doesn’t also rotate! I did try a skeletal mesh approach to solve this but currently it is beyond my abilities.
I will mark as solved but any suggestions for improvement are appreciated!
From the pic, it’s not working correctly. It should ( and does for me ) work like a normal ball. I’m a bit pushed for time rn, but will come back later…