Announcement

Collapse
No announcement yet.

Dynamic gravity for characters

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

    would this work for creating gravity for planets(spheres)?

    Comment


      Has anyone set this up in UE4.15? thats what im trying to use but visual studio is bringing up 9 errors and 2 warnings.

      Errors/Warnings:

      Severity Code Description Project File Line Suppression State
      Error C2027 use of undefined type 'UDamageType' CodeGravity D:\Projects\Unreal Projects\CodeGravity\Source\CodeGravity\NinjaCharacter.cpp 41

      Severity Code Description Project File Line Suppression State
      Error C2227 left of '->DamageImpulse' must point to class/struct/union/generic type CodeGravity D:\Projects\Unreal Projects\CodeGravity\Source\CodeGravity\NinjaCharacter.cpp 41

      Severity Code Description Project File Line Suppression State
      Error C2789 'ImpulseScale': an object of const-qualified type must be initialized CodeGravity D:\Projects\Unreal Projects\CodeGravity\Source\CodeGravity\NinjaCharacter.cpp 41

      Severity Code Description Project File Line Suppression State
      Warning C4458 declaration of 'CharacterMovement' hides class member CodeGravity D:\Projects\Unreal Projects\CodeGravity\Source\CodeGravity\NinjaCharacter.cpp 43

      Severity Code Description Project File Line Suppression State
      Error C2027 use of undefined type 'UDamageType' CodeGravity D:\Projects\Unreal Projects\CodeGravity\Source\CodeGravity\NinjaCharacter.cpp 51

      Severity Code Description Project File Line Suppression State
      Error C2227 left of '->bScaleMomentumByMass' must point to class/struct/union/generic type CodeGravity D:\Projects\Unreal Projects\CodeGravity\Source\CodeGravity\NinjaCharacter.cpp 51

      Severity Code Description Project File Line Suppression State
      Error C2789 'bMassIndependentImpulse': an object of const-qualified type must be initialized CodeGravity D:\Projects\Unreal Projects\CodeGravity\Source\CodeGravity\NinjaCharacter.cpp 51

      Severity Code Description Project File Line Suppression State
      Warning C4458 declaration of 'CharacterMovement' hides class member CodeGravity D:\Projects\Unreal Projects\CodeGravity\Source\CodeGravity\NinjaCharacter.cpp 108

      Severity Code Description Project File Line Suppression State
      Error C1083 Cannot open include file: 'PerfCountersModule.h': No such file or directory CodeGravity D:\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Public\Net\PerfCountersHelpers.h 9

      Severity Code Description Project File Line Suppression State
      Error Failed to produce item: D:\Projects\Unreal Projects\CodeGravity\Binaries\Win64\UE4Editor-CodeGravity.pdb CodeGravity D:\Projects\Unreal Projects\CodeGravity\Intermediate\ProjectFiles\ERROR 1

      Severity Code Description Project File Line Suppression State
      Error MSB3075 The command ""D:\Epic Games\UE_4.15\Engine\Build\BatchFiles\Build.bat" CodeGravityEditor Win64 Development "D:\Projects\Unreal Projects\CodeGravity\CodeGravity.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command. CodeGravity C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 41

      Comment


        Originally posted by tsuzumi View Post
        Just want to inform that I couldn't build this in 4.14 and the error I get is that it tries to find "\Epic Games\4.14\Engine\Source\Runtime\Engine\Public\Net\PerfCountersHelpers.h" which is actually located "\Epic Games\4.14\Engine\Source\Runtime\PerfCounters\Public\PerfCountersHelpers.h"
        I got it working in 4.14, to solve this issue you just need to add "PerfCounters" to your .Build.cs file:
        Code:
        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore","AIModule","PerfCounters"});

        Comment


          So I got this working but I was wondering how I could implement a first person view with a standard camera.

          When I reach an almost upside down state, the camera does not rotate it's 'floor position' with the character resulting in crazy flippyness.

          How would I make it so that the cameras base rotation is rotated with the character's rotation on a surface and is that the right way to look at it?

          Comment


            Is this a feature that is going to be integrated into UE4? I can see a lot of use for something like this.

            Can AI controlled pawns navigate around shapes as well?

            Comment


              Same, I've managed to set player rotation and position according to the 'gravity'... but I can't seem to set the animations to follow.

              Comment


                i tryed source it didnt compile

                Comment


                  Any chance of this getting integrated into Unreal? Or at least updated/maintained to newer versions?

                  I really want to be able to use Unreal, but this feature is critical for my project.

                  Comment


                    This branch

                    https://github.com/EpicGames/UnrealE...f3d690de27769b
                    and this conversation
                    https://github.com/EpicGames/UnrealEngine/pull/1773

                    were the best and got me to 4.15.1 but I don't know if anyone is still supporting it. The Ninja character did not seem to work as well. I would like to use this plugin

                    https://www.unrealengine.com/marketp...gravity-system

                    with this video



                    in 4.18 eventually

                    anyone been working on the 3d gravity with the orbit plugin?
                    Last edited by MikeRPG; 10-24-2017, 04:38 PM.

                    Comment


                      Originally posted by MikeRPG View Post
                      I would like to use this plugin

                      https://www.unrealengine.com/marketp...gravity-system

                      with this video



                      in 4.18 eventually
                      I would like too.

                      Comment


                        Thank you so much for sharing this. It's so rare we see such a gem like this pop up.

                        Managed to have a play with this. Really nice piece of work. Considering porting it to 4.19 (4.20 preview 1 this Tuesday, but you didn't hear that from me!)

                        Assuming I set up a scene like in your video, I can't seem to get the character to walk forward around the loop, only strafe left and right.

                        I've tried using your built in Move Forward setup, built in to your NinjaCharacterMovementComponent. I've also tried the AddInputVector method inheriting from the PawnMovementComponent. Both methods seem subject to the same issue.

                        I'm using AddControllerYawInput to turn the character.

                        I'm guessing you ran in to this problem too, hence the demo. I'm wondering if you had thoughts on it.

                        Happy to implement this change and push the changes back upstream.


                        Best Regards,
                        James

                        Comment


                          After a quick hack around, I've created a first draft workaround to the above issue. This is as follows:

                          Firstly, I replaced your input handling code with this:

                          Code:
                          void ANinjaCharacter::MoveForward(float Value)
                          {
                              if (Controller != nullptr && Value != 0.0f)
                              {
                                  // Add forward movement.
                                  AddMovementInput(GetActorForwardVector(), Value);
                          
                              }
                          }
                          
                          void ANinjaCharacter::MoveRight(float Value)
                          {
                              if (Controller != nullptr && Value != 0.0f)
                              {
                                  const FVector AxisZ = GetActorQuat().GetAxisZ();
                          
                                  // Add side movement.
                                  AddMovementInput(GetActorRightVector(), Value);
                              }
                          }
                          Also, instead of using controller input, I am directly turning the character Capsule Component using AddLocalRotation(...).

                          I hate to think the number of aspects of the framework I may have incumbered by directly turning the capsule instead of letting the capsule use the controller's rotation (AI, etc etc etc). Over then next couple of days I'll have a think about what, if any this might have affected and how I might do it differently.

                          I would like to use the controller's yaw, as this seems most inline with the framework, which will not break other Player/AI controller features.

                          First, I'll likely be looking at the Use Controller Rotation (Yaw etc) and why it is dependent on a Z up configuration.

                          I'll report back with my findings.

                          Comment


                            I have an updated version of NinjaCharacter, this time working for 4.19 as a plugin, with several fixes and expanded functionality.
                            I need to fix a grave bug that happens in online mode only, before considering a new release for everyone.

                            Thanks James; for input handling I moved the code to BP, similar to Epic's ArchVisCharacter, and the type of camera I'm using now is third-person, it should be useful for you.
                            Sneak peek in attachment.
                            Attached Files
                            Ninja Character Code Plugin
                            Visual Studio snippets for UE4
                            ---------- ---------- ---------- ----------
                            SonicGDK / Ashura: Dark Reign
                            Heaven of Relics / Relic Madness

                            Comment


                              Impossible to download, 404 error keeps bottering... Could you please uplodad it to another easyer link or download.

                              Please!

                              Comment


                                Originally posted by RoccoFX View Post
                                Impossible to download, 404 error keeps bottering... Could you please uplodad it to another easyer link or download.

                                Please!
                                In order to access UnrealEngine code on GitHub you will need to link your GitHub account to your account here on unrealengine.com.

                                To do so hover your mouse over your username in the top right corner of this page and select Personal, then when the page loads click on Connected Accounts in the left panel, then click Connect for GitHub and enter your exact GitHub username (case sensitive), then click the save button.

                                You should now be able to view the code on GitHub as long as you are signed into GitHub using that account.

                                Because this is a modification to UE4 source he is not able to provide a download on any other sites, the UE4 EULA prohibits it.
                                Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                                Comment

                                Working...
                                X