Dynamic gravity for characters

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.

i tryed source it didnt compile

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

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

branch

https://github.com/EpicGames/UnrealE…f3d690de27769b
and conversation

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 plugin

.unrealengine.com/marketp…gravity-system

with video

=2sJ9JWnlTtw

in 4.18 eventually

anyone been working on the 3d gravity with the orbit plugin?

I would like too.

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

Managed to have a play with . Really nice piece of work. Considering porting it to 4.19 (4.20 preview 1 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.

I’m using AddControllerYawInput to turn the character.

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

Happy to implement change and push the changes back upstream.

Best Regards,

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

Firstly, I replaced your input handling code with :


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 might have affected and how I might do it differently.

I would like to use the controller’s yaw, as 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.

I have an updated version of NinjaCharacter, 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 ; 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.

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 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 is a modification to UE4 source he is not able to provide a download on any other sites, the UE4 EULA prohibits it.

Does by any has to do with movement updates and a ServerMoveHandleClientError() ?
Have been using your NinjaCharactermovement code for a while now (currently also in 4.19). However, I recently started working on online implementation, and keep getting crashes once the client pawn moves.

Thanks for all your work on , and sharing !

regards
Frank

Nope, the problem I have occurs with control rotation and online mode, no crash.
I remember there were crashes ages ago, but I’m not sure if they were related to what you mention.

When I enable ‘Ignore Client Movement Error Checks and Correction’ in the movement component it seems to stop crashing. I guess those checks and corrections can’t be used together with the altered gravity on the movement?

thanks
Frank

turns out that wasn’t the culprit, still get the crashes.

Ninja Character plugin for Unreal Engine 4.19.2 is up! Go to >> UnrealEngine · GitHub << and grab the ZIP file (not the green button) from the link posted at the top part (if error 404: log in to Github, link your UE4 account to Github).

is for C+±based game projects.

And I didn’t fix my online bug related to ControlRotation yet.

Awesome, having a look now ! :smiley:

, thanks for your work :slight_smile: but your link does not work. Getting still 404. (i am logged in)
I browsed your github repositories and there aren’t any unreal releated projects. Perhaps it is configured to private? Don’t know.
Can you please post the zip in thread?

EDIT:
Have you done something?
I just saw that i got an email (after linking) that invited me for joining Epic Games organization on github.
I see your repository now.
If you haven’t done anything so just linking the UE4 account to github doesn’t give me access.
I also have to join the epic games organization on github.
Anyway it works now. :slight_smile:

Hey

First of all, thanks for the update!

Got a few questions though:

  • On a spherical world, I still get a gimbal lock with the spring arm. I used to fixed by setting the absolute rotation on the spring arm, and have the control inputs add to that rotation (without using controller yaw/pitch nodes). However needed quite a lot of extra math. I tried using the pawn from your example, however has the same result. Is still needed to avoid gimbal lock?

  • Setting gravity direction each tick (with only Align Component to Gravity enabled), makes the pawn rotate snappy (is custom direction evaluated each tick?). I tried interpolating the gravity direction, which didn’t work either.

My previous setup completely ignored the control rotation. I first set the gravity direction each frame, then according to the gravity I set the actor rotation (using MakeRotFromXY), then set spring arm rotation, then capsule rotation. all felt a bit like an overkill (cause there was also a lot of extra math needed for other mechanics like aiming and so on). So I was wondering if is still needed with your update, or that I’m simply doing things wrong.

If all sounds too trivial, please drop me a PM, so I can elaborate the issues I’m having!

Thanks!

Frank

…com/=cAtlpOk-VlE

I don’t have any problems with gimbal lock; aside from the C++ code I added, I also rely on some blueprint nodes embedded in the character blueprint, make sure you didn’t miss those.

Hey

I actually tested with your example player. I only added a custom gravity direction on event tick, so the gravity turns spherical. And only enabled ‘Align Component to Gravity’
Still get jittery movement (I also noticed in your video), and the yaw/pitch gets in a gimbal lock.

ninja.PNG

In my previous setup I didn’t notice the choppy movement, because I was rotating the player and capsule each frame. However I couldn’t use the control rotation at all, and had to add a workaround to drive the camera (in worldspace). Huge downside was the controller rotation and all the controller functionality couldn’t be used, since i was unable to get that propely working spherical. Using the forward vector and gravity direction to create a rotation.

setrot.PNG

I wonder where the choppy movement comes from, it kinda looks like the rotation isn’t actually updated each tick. I did notice a treshold in gravity change per frame in one of the functions, could that be causing that? It does happen somewhere in code I think, interpolating the gravity between frames from BP didn’t make a difference.

I had plenty of rotation issues before, and most of the time fixed those by setting each axis separately, Im not sure if that would also fix the gimbal lock though.

hope you can help me on , or give me some pointers where to look! Most I did was in BP since I only know some C++ basics.

thanks!

cheers
Frank