Changing world gravity on sequencer

So I’m doing a scene where I want basically all of the meshes to have 0 gravity at one point and then return to normal. All of this on a sequencer since its not a game what I’m doing. With this in mind I am making a bp actor for every mesh that lets me change gravity to whatever number I want on the sequencer, but, there are too many meshes, and, I really think there is a way to change the gravity of all meshes at the same time on the sequencer somehow. Still, I don’t know how and this is why I am asking here today, does someone know a solution?

Might be possible if you make a variable for gravity that can be changed with a timeline.

I agree with you, but, I have no idea how to do it.

If you make an event track in your level sequence then add a key frame to it you can double click that keyframe to create a new function in the sequence director (this is basically another type of blueprint). In this new function you can do something like [this][1]. More information on event tracks can be found [in the docs][2].

Of course, you get you should probably get only the actors of your custom type instead of all actors. Additionally, without more information I am not sure how you are changing the gravity, but it seems like you have that bit sorted already :slight_smile: But just in case I’ll mention, you could use this sequence director function to get all actors of your custom type, cast to that type, then call an event you’ve made on your custom actor that uses a timeline to slowly turn gravity off instead of all at once.

1 Like

Hi! Thank you for your answer. I’m not home yet so I can not try it yet but there is something I would like to ask :D. What do you mean by:

you could use this sequence director function to get all actors of your custom type

Do I have to make a custom type, group them or something like that? And how?

I do have it figured out, but, this is the way I do it. As you can see it is an actor blueprint which lets me add a gravity option on the sequencer, but, I have to do it mesh by a mesh which is time-consuming, so, you just helped me a LOT. Thank you and I hope you can explain me this :smiley:

I was chicken and I use the 4.17 version of unreal which means I can’t do that. Still, thanks for the help.

I don’t have 4.17 installed, sorry about that. But if you have the ability to call functions from sequencer that are on actors, then the same principle I showed above should be fine. Make a new actor blueprint add it to sequencer and call a custom function on it that gets all the actors that you wish to change the linear velocity of.

I am not sure how you have set up your map whether you made a custom actor blueprint type for objects that should be affected by gravity or whether you just dragged static meshes into scene.

If it is the first one, then the use the “GetAllActorOfClass” and for the actor class parameter choose your custom actor blueprint type. If it is the second thing, you could use "StaticMeshActor " as the parameter (but this will get all static meshes including wall, floors etc so probably not what you want). So you probably want a way to indicate which meshes should be affected by this gravity effect and which ones not.

Two ways come to mind:

  1. Make an actor blueprint and add a static mesh component to it, then for each static mesh you placed in your scene replace it with this blueprint and set it to the correct mesh in scene (this will take a while because you have to replace all the things in your scene you want affected).
  2. Or alternatively, select all meshes in your scene you want to affect then in editor scroll down to tags on the right-hand side and add a new tag to them all, say “anti-grav”, then in a new actor blueprint function you intend to call from sequencer make a “GetActorsWithTag” node to get them all and then loop over them and set the linear velocity as you wish.