Download

Dynamic mass on individual elements of physics system - SeeSaw

Hi…

I’m doing a simple prototype of a Seesaw and it seems you cannot dynamically alter the mass of objects.

I can set different values for the cubes and the system works, but I am unable to dynamically set the mass of each of the cubes…

I can change the ‘scale’ of the cubes which kind of works… but seems a bit back to front implementation.

thanks in advance.

Solved

Well it looks like you can’t do this with standard components in BluePrints so I just extended the StaticMesh Component through C++ instead… seems to be working well enough…


	FBodyInstance* BodyInst = GetBodyInstance();

	void SetMassOverrideInKg(FName BoneName, float NewMass, bool bOverride)
	{
		if (!BodyInst) return;

		BodyInst->SetMassOverride(NewMass, bOverride);
		BodyInst->UpdateMassProperties();
	};

https://youtube.com/watch?v=JANuTR2XBCI