[FollowerEntity] Manual Player Jump Movment

Hi all,

I am wondering what is the recommend way to do a manual player jump movement using FollowerEntity? Becuase FollowEntity using recast graph and a jump break it out of the pathfinding.

If I use followerEntity.isStopped = true; It will try to repair the path to pull the character back to ground. If I use followerEntity.canMove = false; instead then it doesn’t uses physic and gravity.

I end up making it partial working by swapping it with using a ridgidbody during jump. While it’s partially working, don’t really like end up with 2 different physics and probably need to deal with character reached a non-pathing area on landing.

Just wondering if anyone have an alternative take on this or a way via using followerEntity. Not too experience with ESC at the moment but I suppose there should be a way via using ECS physics instead of swapping with rigidbody physic?

Thanks all.

I think the answer on this depends on why and when they’re jumping in your specific case. Can you give us some more information on when the player is jumping and how?

In general, I’d also check out the Manual Player Movement section of the Documentation- it doesn’t cover jumping but it does cover using Astar with manual movement.

Thanks for the reply!

Yeah I am using the Manual Player Movement from the documentation.

What I am implementing is a third person character jump (Press space to jump up and w for forward jump). I guess the use case would be for jumping over obstacles such as barriers/fences and thinking about doing stuff like air dash movement.

You made a very valid point thought. I am actually thinking the same thing recently on why. While it does give player more freedom of movement, I am not sure it justify the potient of more bugs occuring from reaching non-pathing area consider I am using FollowerEnitity navmesh for player movement.

I guess with jump, would be cool to implement something like if the player jump and a bolder come flying via a boss attack or catapult, it will knock the player flying.

No problem! Actually, follow-up question, is there a reason you’re using Astar for the player entirely? Do they ever need to do any pathfinding themselves, or is the player most always in control? If you just need the player to auto-walk somewhere on seldom occasion, I think I’d recommend building a standard character controller, then creating paths, and having the player move through that path. But if you don’t need any other AI-like features, I don’t know if the Manual Player Movement example would be particularly helpful. Let me know if you need any help getting a normal player controller to follow a path :+1:

Interesting thought.

I am actually conflicted on using FollowerEnity on the player or just a seperate player controller.

Currently player is most always in control. No need auto-walk.

The main reason I am using it at the moment is:
!. Easier to implement NPC to NPC reaction and NPC to player reaction since if both NPC and player uses same logic and same FollowerEntity. I don’t need to create a seperate logic for NPC to player reaction. (such as local avoidance)
2. Advantage of when moving into an obstacle such as running at a tree, the agent will automatically move around it.
3. Easier to quality control, anything player can not do due to pathing, NPC can not do either.

An interesting thought that bring up is that with AI on player character, I could actually do stuff like if player is idle for a while, ai will take over and move player to lets say a chair near by and sit down or lean on a nearby wall. :thinking:

I’d probably still recommend handling local avoidance logic with players without using a FollowerEntityon the player. There’s a section at the bottom of this page of the documentation that goes over doing that. This can be easily implemented as something like an interface so that you can attach a “response” to locally avoid anything including players.

What type of game are you making? Top-down or something of the sorta?

This is true yeah :smiley: But I think I still recommend going and adding pathfinding to your own character controller instead of adding your controls to pathfinding. Regardless, whatever you need help setting up, let us know and we’ll help how we can :+1:

Just an idea, couldn’t you make the jump logic just move a child of the FollowerEntity? Wouldn’t even need to use physics, just a simple gravity equation to make the child fall back to the local zero position.

Instead of setting isStopped or canMove, just block movement inputs so all the FollowerEntity logic still works while in the air. The only problem I could see with this solution is if you plan to jump over other FollowerEntities. Might need to disable RVO while in the air in that case.

Haven’t check the form for a while. I end up not using Jumping for now. Thank for the help!

What type of game are you making? Top-down or something of the sorta?

I am making a 3rd thrid person RPG.

Thanks! Yeah I had the same Idea. Make a seperate Jump logic that not relies on pathingfinding and teleport upon landing. But will need to check the landing location I think.

But I end up not doing Jump movement for now. Maybe will come back to explore about jumping in the future.