Board Game waypoint individual actions help

Hey guys, i’m trying to develop a board game. Idk how to explain, but i’ll try. The game consists in: 1 dice, 2 players, 21 waypoints, 1 manager and UI stuff (it works fine). The board waypoints are geometric shapes (circle, square, pentagon and hexagon) and the dice gives one of them. Each waypoint have a scriptable object attached to set the geometric shape related and actions like “walk 2 steps” or “back to start”. Every turn:

  • The dice is allowed to start a couroutine to select a shape;
  • The selected shape is passed to the manager;
  • The manager calls a function inside player’s script that changes the current player’s waypoint Index;
  • The player loops all waypoints[ ] until finds a shape that corresponds to the dice and moveTowards that target.

That part is working well. What i need now is:

  1. Find a way to check and execute the waypoint action only after the player arrives the waypoint ( player transform equals to waypoint transform);
  2. Changes the turn to Player 2.

Note: All actions are implemented already. I just don’t know how to and where call the functions. I don’t think player’s update is the best because the turn keeps changing every frame.
Sorry for the long text and the mess, but i’m worried about it. That project is very important.

I’d use a coroutine to execute the player’s entire turn in sequence:

IEnumerator PlayerTurn()
{
   yield return StartCoroutine(RollTheDice());
   yield return StartCoroutine(MoveThePlayer());
   yield return StartCoroutine(ActivateWaypoint());

  // swap player and go again or end the game
}

Something like this just to give you an idea.