Download

Scaling a static mesh about the z axis

Hi,
I am new to UE and programming. I want to scale a cylindrical static mesh to represent the filling of a tank with liquid. I managed to get it to work but it is scaling in both the negative and positive z axis. How do I get it to scale in only the positive direction?

This is the code I used:

	TankMesh->SetRelativeScale3D(FVector(1, 1, TankPercentFill));

This is how it looks https://youtu.be/uST46mwHD5g

Meshes scale around their local origin. In your case the origin is in the centre of the cylinder. If you model your cylinder so it’s origin is at the centre of the bottom face then it will scale in the way you want.

Ah, okay. That was one of the shapes available in UE4. So I guess I will have to create a mesh in blender with the origin at the base for my tank then. Thanks for the info.