Is the Time.deltaTime needed for moving navmeshagent?

Hi Everyone,
I’m a bit of a noob. still learning.
I have read like to make it moving things not depend on framerate, multiplying it to Time.deltaTime makes it do not depend on framerate.

For navmeshagent movement(like agent.destination = destination; )
Do i need that Time.deltaTime thing to make it non depend? or not?
If yes how do i do it?

Thank you

In this case you don’t need to do that because the movement is processed by the navmesh itself and it takes care of it.
You only need to do that when you’re calculating the values and do the movement yourself.

In this case you only give a location (preferably one time and not every frame).

Hi Lurking Ninja,

Thank you for your response.

On my project use like a click then the character tries to go to that location. so the destination is set once.(but called many times).
but i’m worried like on other computers with fast framerate. the character goes faster.

is it fine i put the
agent.destination = destination; in the update method?

onclick = destination = click destination

void Update(){
agent.destination = destination;
}

unity does the movment with frame independently?

1 Like

It’s not a good thing. If your destination didn’t change, do not add it more than once.

Yes.

Hi Lurking Ninja,

Thank you very much for responding.

Sorry to ask again, i’m very very noob.

How do i make the agent move a step going to the destination without the
agent.destination = destination;

I read it here that to make it move they put it on the update method
https://docs.unity3d.com/Manual/nav-MoveToClickPoint.html

how do i make it do 1 step to go to destination? without just setting it again like the one above(agent.destination = destination; )
like a function to do it?

This is setting the destination only once: when you hit the mouse button. This is good. As I said, you should set a destination once. If you click again, you should set it again.

Some basic NavMesh tutorials: https://learn.unity.com/tutorial/unity-navmesh

Hi Lurking Ninja,
Thank you for responding again.
Sorry i was not able to understand it at first.
Now i understand a bit.
This is the thing i was looking for.