Yea I was wondering the same thing, kind of just brushed over that it by default looked pretty terrible. Probably would have to tweak things similar to the platforms example previously shown with the AgentLinkMover class.
On line 58 of the AgentLinkMover script the speed is set using agent.speed, change this to use a float variable of speed that you can set in the inspector. Now you can adjust the speed to smooth the movement across the off mesh link.
Nice vertical navmesh ;) I have tried connect ground and vertical navmesh but i havent figured out yet. Is there a way or trick? Navmesh link does not work.
It does work You have to tell it to do so with further code representing the change in y direction Your agent needs to be told its changing its direction If you have a rigidbody contained That needs changing If your agent is using update code to move it needs a bool to switch its axis Etc etc
Hold ctrl when rotating on an axis to snap to a degree Half circle Quarter circle are easy to define correctly without needing to type in 90 or 180 Or just type them into the inspector
Could we have a tutorial where if we have different ground materials the AI will priorities to walk on the faster path? Meaning we have a grass material and a concrete path material the AI will rather walk on the concrete.
As i know no, since you carving out the hole from the navmesh and it act as a navmesh obstacle. However if you rebake the whole navmesh to create the hole on the navmesh that can be resource heavy for the scene. For example if you have the same box as in the video that you can pick up and throw and whenever it touches the ground the navmesh get rebaked: using UnityEngine; using Unity.AI.Navigation; public class BakeNavMeshRunTime : MonoBehaviour { public NavMeshSurface surface; void OnCollisionEnter() { surface.BuildNavMesh(); } } If you have lots of agents and big scene the script above can cause some performance issues especially if the code runs from multipe objects like the box shatters and each box pieces rebake the whole navmesh surface each time it touch the ground (or anything). I belive they will cover this topic in the next video where they mentioned the dynamic navmesh creation at 9:42. I mainly use this technique when said random layout created and i need to create a navmesh for it. It also should be behind a loading screen so the player will not see anything from it.
If you load asynchronously whilst something else is happening to the client youll be able to dynamically change navmesh across an entire scene quite quickly Unless you have thousands of small obstacles I can't see the impact on performance being too intensive 10 to 50 objects of varying sizes should be fine More than that you'll need to look into dots Which is advanced programming
I dont know who is running unity's youtube channel but God Bless them! They are doing a great job with all these tutorials.
Is there a way to make agent smoothly transition from one surface to another using link? That transition on 09:33 looks abrupt.
Yea I was wondering the same thing, kind of just brushed over that it by default looked pretty terrible. Probably would have to tweak things similar to the platforms example previously shown with the AgentLinkMover class.
Mathf.lerp is your friend
Learn this and you can smooth anything
On line 58 of the AgentLinkMover script the speed is set using agent.speed, change this to use a float variable of speed that you can set in the inspector. Now you can adjust the speed to smooth the movement across the off mesh link.
good job. 👍
Nice
Nice vertical navmesh ;) I have tried connect ground and vertical navmesh but i havent figured out yet. Is there a way or trick?
Navmesh link does not work.
It does work
You have to tell it to do so with further code representing the change in y direction
Your agent needs to be told its changing its direction
If you have a rigidbody contained
That needs changing
If your agent is using update code to move it needs a bool to switch its axis
Etc etc
Hold ctrl when rotating on an axis to snap to a degree
Half circle
Quarter circle are easy to define correctly without needing to type in 90 or 180
Or just type them into the inspector
Cool
Nice❤
Could we have a tutorial where if we have different ground materials the AI will priorities to walk on the faster path? Meaning we have a grass material and a concrete path material the AI will rather walk on the concrete.
Thats what area costs are for, they are going to talk about that in the next video
@@v0ltdev Thank you.
Are we going to have DOTS Compatible version?
Is there some performance disadvantage to dynamic obstacles?
As i know no, since you carving out the hole from the navmesh and it act as a navmesh obstacle. However if you rebake the whole navmesh to create the hole on the navmesh that can be resource heavy for the scene. For example if you have the same box as in the video that you can pick up and throw and whenever it touches the ground the navmesh get rebaked:
using UnityEngine;
using Unity.AI.Navigation;
public class BakeNavMeshRunTime : MonoBehaviour
{
public NavMeshSurface surface;
void OnCollisionEnter()
{
surface.BuildNavMesh();
}
}
If you have lots of agents and big scene the script above can cause some performance issues especially if the code runs from multipe objects like the box shatters and each box pieces rebake the whole navmesh surface each time it touch the ground (or anything). I belive they will cover this topic in the next video where they mentioned the dynamic navmesh creation at 9:42.
I mainly use this technique when said random layout created and i need to create a navmesh for it. It also should be behind a loading screen so the player will not see anything from it.
If you load asynchronously whilst something else is happening to the client youll be able to dynamically change navmesh across an entire scene quite quickly
Unless you have thousands of small obstacles I can't see the impact on performance being too intensive
10 to 50 objects of varying sizes should be fine
More than that you'll need to look into dots
Which is advanced programming
Nice