Trying to implement Hero's Path in a simple game.

Hello all,

I’m brand new to Unity. I’m trying to make a puzzle platformer game, where the goal is to find colored cubes in the level, and place them on matching colored platforms. The play space has a very specific shape. What I’d like to do is implement what Breath of the Wild does with Hero’s Path mode, where it keeps track of the player’s path as they journey around. My game is probably only the size of Kakariko Village, but the path they take through it reveals something about the game. Think “The Witness”.

I have a very basic character controller from a Brackey’s video. My thought is that I would keep the player’s x and z coordinates in some kind of array, but I don’t know how to do it dynamically. Zelda’s can keep track of 200 hours, my game may only take 5 minutes… So I turn to you oh great community. What are your thoughts?

Cheers.

@ROSSXVII
Like you said, store it in an array. You can do this every time you update the player’s position.
Maybe you don’t want to do it every frame so you can have a frame counter, and every time the frame counter hits let’s say 100, save the position. But if you want precision, every frame is fine for 5 minutes worth, that’s only 18K entries for 60fps.

You can create a simple struct with just x,y and create a list of that type. And add a new item every time you want to record.

Maybe better to use a Queue, so you can easily control the maximum # of entries, and if your queue is too big, push out the first item.