I wonder if this could be this commit set/get delta step and step count for navigation tick update · MackeyK24/Babylon.js@5ed4724 · GitHub
And if it is the case, as it definitely looks like, @Cedric will have a look soon thanks a ton for your help @MackeyK24
Made a issue: RecastJSPlugin Choppy Movement since 4.2.0 RC6 · Issue #9468 · BabylonJS/Babylon.js · GitHub
The cube movement was smooth as a baby’s but, now you can see its choppy
Here is a playground: https://playground.babylonjs.com/#X5XCVT#261
Hi @MackeyK24 I’m taking a look right now.
As a workaround, you can add navigationPlugin.setTimeStep(0);
so that it will behave as smooth as before.
What is Time Step For ??? What is the best value for time step (other than zero for right now to disable that feature to get my smooth movement back)
Sometimes, the delta time between 2 frames is not 1/60 of a second. When switching tabs for example.
To get consistent behavior, if the delta time is longer, it gets divided in sub steps.
See this thread : Crowd Agents Bug
Is there an example where you set a custom time step ???
What values would you set for time step ???
ATM the default values are suitable for most of people.
If you need extra quality for agent navigation then you can change the maximum sub steps count.
If you want to accelerate or slow down the navigation, you can change the timestep.
I have set time step to ZERO… But its still a LITTLE Choppy. Its much better.
But 4.2.0-RC5 STILL RUNS SMOOTHER
if time step is 0, the same code as 4.2 is run :
Was there a new or updated recast.js library to go along with the RecastJSPlugin update ?
Latest recast.js update is the helper function for off mesh link.
and for the .ts part, off mesh link support and then the delta time PR.
The support for thin instance only touches the navmesh creation so it should have no impact.
Yo @Cedric … I got a question for you… Can we add support for the nav agent to follow a custom path.
Other than agent go to… that only take a destination point. But i need to compute my own path… maybe alter the path points and then give that array of point to the nav agent to follow… Can we do that ???
I don’t know yet. Let me check that!
@MackeyK24 I don’t see a way to tweak the path. Once you set everything (navmesh, agents, …) recast is responsible to handle everything for you. You can query infos but modifications seem complex.
What is your use case? Can you split the problem in the JS side by calling agent.goto once it reaches your sub step. You have to handle the substep and making a new query but you are sure each step is reachable.
Yo @Cedric
How about query the existing path… So when call agent.goTo… i can access the array of path points that the agent.goTo call is following ? Can you add that ?
I can try to expose that.
Not sure if this is still the right thread, but I see some people have solved the problem I have, but I can’t get it to work.
I’m trying to use RecastJSPlugin in TypeScript. I’m importing RecastJSPlugin from from ‘@babylonjs/core’.
I’ve installed the recast-detour package with npm and I’m using babylonJS 4.2.0.
I keep getting this error:
Unhandled Rejection (ReferenceError): Recast is not defined
Happens here:
public constructor(recastInjection: any = Recast)
file: C:/sourceES6/core/Navigation/Plugins/recastJSPlugin.ts:40
Any idea on how to solve this or what the problem might be?
Did you import recast.js in your html?