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?
asked Apr 22 '19 at 05:11 PM in Blueprint Scripting
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. More information on event tracks can be found in the docs.
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 :) 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.
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:
answered Apr 24 '19 at 10:21 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here