Keeping skier inside ski track
Hello,
I am beginner in Unity. I'm creating a ski track simulation and I'm trying to implement simple AI to imitate skier movement. My problem is that I would like my skier to know in which place on slope he actually is.
I thought I could build some kind of invisible walls on both sides of slope and use raycasting to detect it before collision. I didn't implement it yet, is it a good way?
Anyway, my real problem is that I would also like to know his position regarding to middle of slope and I dont know how could I do it. Could anyone show me a way? I mean, i would like to make some kind of line running through the entire length of the slope in the middle of it and skier could count his actual distance from this line.
My english isn't so good so I draw it :)
Thanks from replies ;)