I’ve been trying to look for an efficient way to give a bent effect to a static mesh at runtime as a result of a hit event. Basically bump into a metal bar and bend it. I’m pretty sure it can be done either with world position offset or with splines but not sure which would be better, any suggestions? Also if you happen to know of another method feel free to suggest
Yeah, there’s a few different methods to do this. What you go with will really depend on the individual differences between methods and which one works best for your individual situation.
As @MostHost_LA mentioned, the two most common methods are a math-based WPO or a vertex color WPO.
If you need a complex motion which you can not replicate through simple math or painting, you can also use a baked vertex animation.
If you are able to share the exact effect you want to achieve, I can help you determine which method will work best and help you achieve it.
It was supposed to be water coming out of a hose/pump in the shape of a cone. I had used a cone-shaped mesh to give it some structure, but when the player moved, it had no inertia. I ended up using sprites, which worked alright. But I would still revisit this topic with a much simpler setup to figure it out.
The math of water ouf of a hose is basically a joke when compared to other things (do anything with star positioning for instance).
Pressure, diameter of tube/nozzle, and you are halfway there.
Then you worry about the “drag" factor from moving the hose around.
In fact you can probably just fake the pressure convincingly by using a Predict Projectile Path node and visualizing the result.
And if you were to fire a near constant stream of projectile particles (aka water), you would automatically get the right result without even having to bother on the material…
I think it would be trivial now a days to open up the predict projectile path in VS, feed the code to any AI and tell it to convert it into an HLSL custom node.
At that point, you apply the node to the material and use it to change the WPO of the mesh to bend.
The lenght of the tube is harder to control. In fact, likely don’t bother. Make it so it has no collisions and tmit penetrates things it hits.
Add particles at the hit point to make it rerealistic.
Additionally - all of this should be easily achievable on Niagara as a particle stream without even touching materials, projectiles, etc.
I have made a working sink that way before. It needed to simulate bouncing off a dish, and the particle stream with collision turned on did it perfectly…