[Question] Is it possible to change the gravity scale for a static mesh or Blueprint?

I am able to change the gravity scale for the character and would like to be able to change the gravity scale for other objects as well so the behaviour is consistent . So far I have not found a way of doing this.

Thanks

I agree with Toxic Games,

The best I can do is change the mass scale of a static mesh or other primitive component.

But that is not the same thing as changing gravity!

I ended up having to implement my own custom additional gravity to get the effect I wanted.

It would be nice to be able to set a custom global gravity scale

or is it expected that we just change the world gravity itself? Can that be done dynamically during runtime?

I found a way, the idea is using a ProjectileMovement component for simulating physics.

Create a Blueprint, and add a Projectile Movement component and a Static Mesh component.

On the static mesh properties, change Mobility to Movable, and don’t check Simulate Physics.

Configure the physics parameters on the Projectile Movement component.

On the construction script, bind the Projectile Movement component to the Static Mesh component using Set Updated Component.

If you need to change gravity during gameplay, drag a pin from your ProjectileMovement object and search for Gravity, you’ll see you are able to modify the gravity scale there.

Cheers!

wow this is a great discovery on your part Pinheiro!

Thanks for sharing!

After the static mesh gets binded to the projectile movement, does the static mesh start simulating physics?

Rama

Yes it does.

I remember seeing a gravity scale property while making the projectiles for my FPS game, thus how I came to this idea. :slight_smile:

Great find Pinheiro!

:slight_smile:

#:heart:

Rama

Does this solution still work?
I’ve set up my blueprint as described and basically the mesh just behaves like a projectile and doesn’t actually simulate physics (just the pseudo projectile physics) There is no change in behavior after using SetUpdatedComponent.

my construction script looks this. (The image above doesn’t seem to be the correct one.)

56435-gravity.jpg

Yes it should still work. Explore the properties in the ProjectileMovement component, you’ll probably want to check Should Bounce.

Thanks for getting back to me! Perhaps I misunderstood but I thought that this solution would allow gravity to be changed but also still allow physics interaction. For example. The object currently will fall according to the gravity scale, but will ignore any impact forces.

But, I think this puts me on the right track… I am experimenting with turning on physics briefly when it is hit, applying needed force and then going back to projectile movement in order to get the gravity scale I am looking for.