Announcement

Collapse
No announcement yet.

How to Disable/lower gravity ingame using keybind?

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

    How to Disable/lower gravity ingame using keybind?

    Hello

    i am new to using the Unreal Engine 4 and am currently wondering if there is a way, using Blueprints, to disable or to lower gravity ingame using a keybindng?

    Thank you

    #2
    Maybe this question on AnswerHub will help you?

    https://answers.unrealengine.com/que...e-problem.html

    There i sthis tutorial is well, not sure if it covers your question.

    https://www.youtube.com/watch?v=EZ9klcc6HLk

    Comment


      #3
      Originally posted by TheSpaceMan View Post
      Maybe this question on AnswerHub will help you?

      https://answers.unrealengine.com/que...e-problem.html

      There i sthis tutorial is well, not sure if it covers your question.

      https://www.youtube.com/watch?v=EZ9klcc6HLk
      The first link might help me, i'll have a try what is mentioned on those blueprints if i can figure some of them out.
      That second link was just a tutorial on how to set or disable the world settings for gravity (which is something i already know how to do).

      What I am aiming to do is create a game that relies on the ability to change gravity using the keyboard ingame.

      Comment


        #4
        Originally posted by TheSpaceMan View Post
        Maybe this question on AnswerHub will help you?

        https://answers.unrealengine.com/que...e-problem.html
        I have just read through the first link which provides blueprints but unfortunately they were not very helpful as some of the blueprint nodes they use i am unable to locate such as gravity scale.

        Comment


          #5
          Does Unreal Engine 4 contain a native blueprint gravity node, or does this particular node have to be created for use in the blueprints?

          Comment


            #6
            As far as I know you can't change gravity on the fly


            How many things in the world would be affected? Actors or simply static meshes?

            Comment


              #7
              Originally posted by rodstone View Post
              As far as I know you can't change gravity on the fly


              How many things in the world would be affected? Actors or simply static meshes?

              For the moment the only thing i would like to have affected by gravity on the fly ingame is the character.

              Comment


                #8
                Oh that's easy then! Gravity is "just" a force accelerating everything downwards. Basically, just have an EventTick node and use thee "Add Force" node to apply a vector force downwards on your character. You can make this vector change dynamically through other controls to change the "gravity".

                To do it really properly, use the delta time pin and multiply you vector by that. Your vector will have to be much smaller but that means that the force will be proportional to the amount of time the tick/frame took

                Comment


                  #9
                  Originally posted by rodstone View Post
                  Oh that's easy then! Gravity is "just" a force accelerating everything downwards. Basically, just have an EventTick node and use thee "Add Force" node to apply a vector force downwards on your character. You can make this vector change dynamically through other controls to change the "gravity".

                  To do it really properly, use the delta time pin and multiply you vector by that. Your vector will have to be much smaller but that means that the force will be proportional to the amount of time the tick/frame took
                  Would you be able to produce an example image of the blueprint as I have searched the avaliable variable and function nodes on my blueprint editor and i cannot find the 'Add Force' node.

                  Comment


                    #10
                    Even easier, if you're only talking about a CHARACTER, you can Get the Character Movement Component, drag off of it, and Set the "Gravity Scale" variable to adjust how much gravity affects the given character.

                    Comment


                      #11
                      Originally posted by RhythmScript View Post
                      Even easier, if you're only talking about a CHARACTER, you can Get the Character Movement Component, drag off of it, and Set the "Gravity Scale" variable to adjust how much gravity affects the given character.
                      Ah i didn't know that draging the node linking line brings a list of nodes that is compatible, i have finally found the gravity scale and will try the gravity blueprint from the first reply.
                      Thanks

                      Comment


                        #12
                        Originally posted by Maces006 View Post
                        Ah i didn't know that draging the node linking line brings a list of nodes that is compatible, i have finally found the gravity scale and will try the gravity blueprint from the first reply.
                        Thanks
                        If you want to add the force, you drag it out from a component pin, like a mesh component.

                        If you use the "palette" on the right (which seems disabled by default on 4.5, find it under the windows menu - this is in blueprint editor btw) you can search and every possible function will come up, not just those that are context specific

                        Comment


                          #13
                          I have managed to create this blueprint which has allowed me to disable and then re-enable gravity ingame for my character:
                          Click image for larger version

Name:	53c0a208be8b79605562538fffe9051e.png
Views:	1
Size:	112.3 KB
ID:	1057945

                          Thank you everyone

                          Comment


                            #14
                            Adding to rodstone's post ^^ you can also un-check the "Context Sensitive" checkbox from the menu that pops up when you right click / drag off a wire as well.

                            Wish this was better documented, there are a lot of people using UE4 that do not know that dragging off of certain nodes shows a different result, it causes a lot of confusion.
                            Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                            Comment


                              #15
                              Originally posted by DotCam View Post
                              Adding to rodstone's post ^^ you can also un-check the "Context Sensitive" checkbox from the menu that pops up when you right click / drag off a wire as well.

                              Wish this was better documented, there are a lot of people using UE4 that do not know that dragging off of certain nodes shows a different result, it causes a lot of confusion.
                              Yeah this is exactly why i was having difficulty finding any force or gravity nodes, thanks again everyone

                              Comment

                              Working...
                              X