Is it possible to deform a mesh in game?

For example, if I have a cube, is it possible to write a script so that when I press a key in-game, I change the shape of the cube to something else that also has 8 verts.

2 Likes

Doing that with few vertices is quite easy to do with procedural meshes, with more complex meshes it’s better to create an animation in a 3D software and run it in unreal

2 Likes

Hey, thanks for replying!
What I want to achieve is that the player can select a mesh in-game and deform it into another with the same number of verts (by interpolating vert pos).
I’ve never used procedural meshes. Is it possible to achieve with it?

The reason I’m not considering animation is that I want this function to be applied to a lot of meshes in game.

2 Likes

I have literally created an entire procedural dungeon with these (so you can do everything in theory), but it’s kinda tricky to understand at first and you will need a lot of math.

You need to literally draw triangles between vertices and move them singularly, probably the animation is the fastest way to do it (even if you have to do it for many solids)

2 Likes