In this tutorial, we will implement a generic pathfinder in Unity using C#. We will approach the tutorial from a basic 2D grid-based pathfinding to a more robust generic pathfinder that we can use for a graph-based data structure. We will then apply our pathfinder to a variety of pathfinding problems.

Originally published at https://faramira.com/implement-a-generic-pathfinder-in-unity-using-csharp/ on July 5, 2021.

Get the code from GitHub

See the WebGL working demo at https://faramira.com/downloads/pathfinding/

Pathfinding

Pathfinding is the plotting of the most optimal route between two points by a computer application. The most optimal path is usually associated with identifying the path that…


This tutorial first appeared on Faramira.

In this tutorial, we will implement a configurable third-person camera control in Unity for an animated character. Our target game object for this tutorial will be a proper animated game object rather than a cylinder or a capsule.

Look at the video below on what we will achieve by the end of our tutorial.

This tutorial is divided into three sections.

  1. In Section 1. we will concentrate on setting up the scene and the animated character.
  2. In Section 2, we will implement the necessary third-person camera controls for PC, Linux and Mac build…

Implementing a Finite State Machine Using C# in Unity - Part 1

In this tutorial, we will learn about Finite State Machines and implement a Finite State Machine using C# in Unity. We will then apply the implemented FSM in two different scenarios to illustrate the concept.

The tutorial is divided into three parts.

Part 1 introduces a Finite State Machine and implements a generic Finite State Machine in C#.

Part 2 uses the Finite State Machine created in part 1 and applies to a Unity project in a simple straightforward UI implementation of a Splash Screen. See a video of the example implementation.

Part 3 uses the same Finite State…


CPF Simulator to Optimize Your CPF Amounts

This is a CPF Simulator that simulates the CPF accounts based on publicly available information. You can use this simulator to optimize your CPF account outputs by comparing and contrasting across multiple simulation runs.

Check out the CPF Simulator on Faramira


How to Generate Mazes Using Depth-First Algorithm

In this tutorial, we will learn how to generate mazes using a depth-first algorithm. To do this firstly, I will define the problem, then I will explain the algorithm and finally demonstrate the implementation in Javascript. We will use P5js to demonstrate the working of the maze generation.

Check the tutorial on Faramira


Implementing a Command Design Pattern in Unity

In this tutorial, we will learn about Command Design Pattern and then implement a Command Design Pattern in Unity to solve the movement of a game object.

Read also: What Are C# Delegates And How To Use Them

Read also: Solving the 8 puzzle problem using A* (star) algorithm

Introducing the Command Design Pattern

Requests, Orders and Commands: We are all familiar with them in
real life; one person sends a request (or an order or a command) to another
person to perform (or do not perform) some tasks that are assigned to
them. …


What Are C# Delegates And How To Use Them

C# delegates are a type that represents references to methods with a specific function signature. In short, delegates are references to methods.

An instantiated delegate can be associated with any method that has a compatible signature and return type.

Read the post on Faramira


The Mullet is Making a Comeback. I Have Some Thoughts.

The mullet is making a comeback.

The notorious “business in the front, party in the back” haircut — so prevalent in the 1980s and 90s — has made a remarkable return. In magazines, on the internet, and in stores like Walmart, if you find yourself in the right place at the right time, you might just be graced with its presence and beauty.

Read the post on Faramira


Country-Capital Quiz - Countries starting with Letter B

Country-Capital quizzes are fun. Take a quiz on all the countries starting with the letter B and see how many capitals you can get correct.

Countries starting with the letter “B”

Take the Quiz


Beginners Guide to Intermittent Fasting for Weight Loss

This is a Beginners Guide to Intermittent Fasting for Weight Loss. There have been a number of how-tos as far as weight loss is concerned. One thing that is common in all these how-tos if the fact that they will tell you to eat this, don’t eat that or eat more of this and less of that and so on.

Read the post on Faramira

Faramira SG

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store