Moving along a path how to's

Hi, I am very new at Unity and I’m working on getting my project moving but I’m kind of stuck on the actual mechanics portion of a certain key part.
The game is in 3D but mostly occurs on the XZ axis, has multiple levels that have to be finished in order. The character moves a certain number of units according to the roll of a dice. The path, is a series of specified spaces, but it also contains “forks in the road” ( sort of like in the board game Life). The character can not move backwards and must move the entire number of spaces and cannot choose a different path once starting down the original chosen one. One major factor too is that certain landing spaces have certain consequences such as, Redo a turn from original space, or a certain percentage taken off the next dice roll, etc.

My question is which method should I focus on for this: Navigation mesh, Lerp, transform, triggers, vector 2?

I have watched and performed all the tutorials, been doing a lot of reading of the manual, watching independent YouTube videos, etc…It seems though, the more I read and watch videos, the more I get confused as to how to handle this.

Thank you very much in advance for any and all help.

Doc

You don’t need a navigation mesh.

Those other things you mention are all things you will use. Your question is akin to: I need to build a house, but what should I focus on — hammers, drywall, measuring tape, or 2x4s?

You’ll write code to move the game pieces along the paths. It will do this by using Lerp (hopefully correctly) or MoveTowards (easier to not screw up), probably in the Update method. It will check each square as the piece arrives to do those other effects you mention — which you will also write code for.

I can tell that you can’t visualize all that at once, so, don’t. Just find the first tiniest part of it that you think you can get your arms around, and do that. Get a character to appear on the screen. Get it to move at a steady pace in a certain direction. Get it to move for a certain amount in a certain direction, and then stop.

Keep building up in this way until you have all the parts you need to make your game.

Good luck!

  • Joe
2 Likes

Your question is a bit weird and I can’t tell why you added those items to the question…

But your preface is enough to give help on this. Let’s keep the Life board game analogy going. Think of each tile on the board as an object that has a transform (a position and rotation) and a link to the next tile. A fork will contain links to all branches. Your tiles will also have other parameters associated with it too, I’m sure. Now it’s just a simple matter of keeping track of which tile your on and moving is just looking up the next linked tile.

How you actually move your character is up to you. You can use Mechanim, Lerp (be sure you use correctly, the tutorials you watched most likely used Lerp incorrectly), MoveTowards, position, or translate. If you know what tile you’re on, you can also know where you are (dimensionally) and where you need to go. Not sure if you’re using tiles or what for your ‘specified spaces’, but a tile here is more of a container to hold a position and other data than an actual visible object.

Good luck with your project.

2 Likes

Joe and Bill,
Thanks for the replies and the guidance. After reading your replies, newbie questions like mine almost seem stupid. At the time of writing them however, they make perfect sense until guidance like yours is offered.

As there is very little (to none) in the way of tutorials for “board games”, hopefully when I’m finished and better equipped, I could put something together and post it somewhere to help future newbies.

Thanks again for your replies, I’ve got some work to do (with my hammer, 2x4’s, drywall, etc. LOL)
Doc

1 Like