Announcement

Collapse
No announcement yet.

How can I disable gravity in a level ? (or change the world gravity, not just an specific actor

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I disable gravity in a level ? (or change the world gravity, not just an specific actor

    Hi there.

    I need to disable gravity in all objects in scene, doiong so object by object seems a bit strange, is there a way to modify the world gravity for a level?

    Cheers and thanks!

    #2
    There is a world setting tab in the Editor, But I assume by scene you mean a certain section of said level/map?

    If section: I would use one or more bounding volumes to enable/disable gravity when the actor enters/leaves.

    HTH
    Never say Never, Because Never comes too soon. - ryan20fun

    Frames Per Second is NOT a proper performance metric, You should use frame time. You can read this or this as to why.
    (Profiling) Tools: RenderDoc (UE4 Plugin), NVIDIA nSight, AMD GPU PerfStudio, CodeXL
    Good articles/Series: A trip through the Graphics Pipeline 2011

    Comment


      #3
      it's not a section, I want to modify it for the whole level, like modifying the world gravity value, but I can't find a way to do that.

      If I want to do it with a volume, what do I have to do, with a blueprint in that volume? Because what I don't want to do is to modify all actors one by one.

      Cheers and thanks!

      Comment


        #4
        Originally posted by Juangea View Post
        it's not a section, I want to modify it for the whole level, like modifying the world gravity value, but I can't find a way to do that.
        On the right side of the editor should be a tab called "World Settings", Which is below "World Outliner".
        You can set the gravity there.

        Originally posted by Juangea View Post
        If I want to do it with a volume, what do I have to do, with a blueprint in that volume? Because what I don't want to do is to modify all actors one by one.
        You will need to create a blueprint that has a collision volume set to overlap.
        Then you use the "on overlap" event of that volume to disable the gravity(IIRC the node is called "set enable gravity")

        HTH
        Never say Never, Because Never comes too soon. - ryan20fun

        Frames Per Second is NOT a proper performance metric, You should use frame time. You can read this or this as to why.
        (Profiling) Tools: RenderDoc (UE4 Plugin), NVIDIA nSight, AMD GPU PerfStudio, CodeXL
        Good articles/Series: A trip through the Graphics Pipeline 2011

        Comment


          #5
          Hi ryan.

          Thanks, I know the gravity value in the world tab, the problem is that I can't find a way to modify it in runtime, like having three keys, one for 9.8, another for 0.0 and another for 4.3.

          On the other hand what you mean is thta I use the overlap of the volume blueprint to modify every actor inside of it, am I right? That can work and I did not thougt it hehe

          Thanks! If you know hos to change the gravity value at runtime tell me that too please

          Cheers!

          Comment


            #6
            Originally posted by Juangea View Post
            Thanks, I know the gravity value in the world tab, the problem is that I can't find a way to modify it in runtime, like having three keys, one for 9.8, another for 0.0 and another for 4.3.
            After a quick search and check, I am unable to find a way to adjust gravity z at runtime.

            There is a world settings class that can be accessed which has world gravity z, But it is marked as const(read only).
            I don't know if casting away the const will do anything, Will have to look deeper into that.

            Originally posted by Juangea View Post
            On the other hand what you mean is thta I use the overlap of the volume blueprint to modify every actor inside of it, am I right? That can work and I did not thougt it hehe
            Yes, that is what I said (and have done before)


            Originally posted by Juangea View Post
            If you know hos to change the gravity value at runtime tell me that too please
            The only workaround I know of is to disable the world gravity and apply a force to all dynamic actors to simulate the desired gravity.
            The downside is that physics objects won't be put to sleep as the force will keep them awake.
            So there would probably be a large performance impact for having lots(>25?) of physics bodies kept awake like that.

            HTH
            Never say Never, Because Never comes too soon. - ryan20fun

            Frames Per Second is NOT a proper performance metric, You should use frame time. You can read this or this as to why.
            (Profiling) Tools: RenderDoc (UE4 Plugin), NVIDIA nSight, AMD GPU PerfStudio, CodeXL
            Good articles/Series: A trip through the Graphics Pipeline 2011

            Comment

            Working...
            X