If you remember, in the NavMesh documentation there was a part that refers to how Ai moves even if the two points are spaced by an offset, or a difference in height.

I set up this part in our…

Unity : AI && NavMesh [FSM : (Finite State Machine with Enum)]

This is a BIG topic. The FSM is one of the most useful and use design pattern in video games (it call even State Pattern).
Its implementation has various form, one of them is with Enum and a switch Statement. …

Unity : AI [Navmesh implementation (Part IV)]

Ok, we need to fix the little bug we had in the previous article.
Let’s explain what the problem is :
After we reach every points, the code try to search for another point which don’t exist, so we have an ArgumentOutOfRangeException.

A simple way to fix it is to…

Unity : AI [Navmesh implementation (Part III)]

At this point we have the AI that can walk to one point randomly.
But what we want to do is make the Ai goes from point A to B, C, D, E and at end go towards F point.
And restart its path.

We have already o good part…

Unity : AI [Navmesh implementation (Part II)]

After we set up the Scene, it’s time to create our AI.
I create a sphere.

I even create a material and apply to it.

What we want is make the AI to move from point to point in a “path”.

The first step, is add a component to the…

Unity : AI [Navmesh implementation (Part I)]

In this article we talk about something incredibly useful and really fun : the AI with Navmesh implementation.

This is a series of articles on how Navmesh works with a (basic) AI implementation.
Let’s start from here up to what is called FSM or FINITE STATE MACHINE.

Let’s create a…

Unity : use Raycast for move the Player

Today we see another useful method when to use Raycast.

We create a simple scene with two Cubes, one withscale 10, 1, 10 that we use as the Floor.

Then we create two scripts, one for “Player” and one for “Pointer”.

Unity : Raycast for check Distance

In the previous articles we have seen how use Raycast to check the collisions.
Today we see how use Raycast to check the distance.
In code this not change too much and now we see how it works.

This is my scene :
I create a Floor (with a Cube with…

Unity : Raycast (Part III)

In this article we continue to learn how works Raycast and when (and for what) we can use it.
In the previous part we had seen which syntax is and how works the Raycast, how we store the information into RaycastHit hit and every time we hit something we retrieve the…

Matteo Lo Piccolo

Always in love with programming, even if late (I'm already 39 years old) I decided to follow my dream! We will see how far my passion will take me!

Get the Medium app