Making the player follow a "tracer"

Started by
1 comment, last by Christoher Randin 11 years, 3 months ago
So, how I want my game to work is entirely using 2D physics. I want my game to work is that the environment is all 3D and so the player can do the normal left/right and up/down, but the catch is I want him to move along the Z axis as well, but without having input control over it, but rather it is indirectly down, by following this tracer when it chooses to move along the Z axis.

So let me try and paint a picture. Say, you have a narrow hallway that only goes left and right, so the restriction in movement only works for Horizontal and Vertical movement, BUT when we reach the end of the hall way there is another hallway leading out, so instead of having the player press up to move forward, we just press 'D' or '->' to make him turn into that hallway, which is done because he is following this "tracer". So in sense the movement Left and Right is working in relation to this tracer.

So think about this image http://img.nobodybuy.com/2010/01/07/sales34776/0x0_p606558/bead-game-bead-maze-toy.jpg and would only be controlled with a left and a right toggle on the keyboard, which in the image uses all 3 dimensions. So pressing '->' will move one of the beads to the right and continue to follow the path until it reaches the end. I have a slight idea on how to make it work, but was wondering if some one could help flesh out this idea. Also, I would need to rotate the player to look more realistic and the camera is attached to the player.
Advertisement
Anyone? Was hoping someone know some method in Unity which could act as a tracer. Meaning I am restricted to this path only and the toggled input act according to this tracer.
Just out of curiosity, I probably found a simple alternative. How would creating object collider, tag as "path" and have my player align with these collider in being constricted on this path way and I could use the Look at function to handle my character directions. I also could store these collider in an area and keep them in order so I could do something like [n] would be facing right and [n-1] would be facing behind, which is left.

This topic is closed to new replies.

Advertisement