Ninja Character - Dynamic gravity for characters & objects

If you (or anyone) are truly determined to contribute with code improvements, let me know through a private message. There are some obstacles to strictly open source this, but there should be a way to accept contributions.

Hello!
Just found out about this plugin and Im wondering if this would plugin work with a VR Game for the Quest 2 where the player uses their hands to interact (no complex controls at all, just grabs and button presses), has a wide walking space so the player can walk with their own feet and move their heads anywhere while walking in a loop like the one in the example level.
I see no mention of VR Pawns, only 3rd person and AI pawns.
I already have a the game working and I’ve been reading through the documentation to see how I could make this work but I haven’t had any luck so far.
Any help is appreciated!

Dear Xaklse ! For a long period of time I have not been able to decide on the UE version for which your plugin with multiplayer support would be suitable, that is, starting from version 1.36.27. I would like to maintain a golden balance between solving problems on the new version of the engine and necessary and necessary changes in your plugin. I don’t plan to use Nanite and Lumen technologies.
Need wise advice.
Regards

section 7 is unclear
j. In “Components” panel, select “NinjaPlayerCharacter_BP(self)”
k. Copy the changed settings you need to your own Character Blueprint
l. In “Components” panel, select “CharacterMovement (Inherited)”
m. Copy the changed settings you need to your own Character Blueprint
Im not really getting what "changed settings " are

Hi there,

First: very nice plugin, thank you very much !

Next, I have a problem, probably related to NinjaCameraManager, in Multiplayer.

This occurs when there is no DefaultPawnClass in GameMode, and I Spawn and Possess Pawn in PlayerController, in reaction to Match State being changed in GameMode.

In Standalone and Listen Server mode, everything is fine, as shown on left side of the picture.
However, in Client mode, the Camera is not right, and I tracked it back to NinjaCameraManager rotation not being the same as in Standalone/Server mode (right side of the picture).

Do you have any idea on how to fix that ?

Lastly, I’d like to adjust a NinjaPhysicsVolume sphere radius in realtime.
But since NinjaPhysicsVolume derives from APhysicsVolume, there is nothing I can do about it right now.
I’ve noticed the only relevant function from APhysicsVolume are ActorEnteredVolume and ActorLeavingVolume. Is it possible to make a similar volume actor using a ShapeComponent instead ?

Thanks.

I have no experience with VR games and I don’t have an HMD to play with. Make sure you’re using the NinjaPlayerCameraManager, if it doesn’t work, then it isn’t really prepared for VR use, sorry.

1.39.27 is the last version that was published for UE4.27.
Even if you don’t plan to use Nanite and Lumen, I would recommend using UE5 and disable those features for your project. Others might disagree.

I meant that you should take note of the settings that were changed in the “NinjaPlayerCharacter_BP” blueprint and repeat them in your own Character blueprint.

The CamaraManager rotation isn’t replicated between machines.
Interesting… it looks like… the Pawn changes its rotation on the Client, but maybe there isn’t a PlayerController (+CameraManager) object in the Client yet… so the CameraManager is created “too late”.
Try to spawn the Character upright and very very far from the small planet, and let the Character fall against the planet, and see the result.

I guess you could try to create a new subclass of TriggerSphere, and copy/adapt the code from NinjaPhysicsVolume.

1 Like

I tried spawning Pawns on a far away platform, then teleport them near the Planet.
The client Pawn rotates correctly, but the Camera get messed up…

thanks for your reply!

Hey, this is just what i was looking for. but i need help

So when i move right and up i move on the right up diagonal but 1 i cant move left and 2 i cant move on the left diagonal.

thank you in advance

@Xaklse congrats on the mega-grant and contributor title, i’m happy you got it.

off topic but @Xaklse , how did you create the slope physics used in sonic GDK?

I have several problems with 90 degree corners.
If I approach a wall, the character stops against it, but I think he should reorient himself on the wall.
While if the character approaches a ledge, a 90 degree edge, the character performs a jump (which is very annoying) instead of sticking down the ledge. Yet, in the presentation video he didn’t do that.

For walls with a tag of “walkable” this would be the solution (I believe OnUnwalkableHit was introduced in 4.26, you may also need to simulate a jump event so the character is in the air before updating the character axis. Also under the ninja character movement component the “Trigger Unwalkable Hits” condition needs to be checked)

For walking off a ledge and having it reorientate the player to what would have been the cliff, there’s multiple gravity direction functions
image

I believe you would want either box or collision

Make sure you’re using the proper PlayerCameraManager object and/or review the Character blueprint input nodes.

Thanks! It has been a while since this thing was started… at least 9 years ago I realize now.

2 Likes

By having a collision cylinder with the same height and width, using a pair of raycasts against the floor, and ‘rewriting’ the flying physics mode. SonicGDK is ‘open source’ so anyone can take a look (and cry).

Try the solution err0s has suggested. The NinjaCharacter doesn’t attach to 90deg walls by default, that’s why you need the UnwalkableHit stuff.