- Home /
How to effectively make a "rail-driven" movement along a path with a little user control?
Hey everyone,
So my question is: How can I effectively make a "rail-driven" movement along a path with a little user control? Meaning, I have an Oval Track (Running Track) and I want to have an object (character) consistently run around the track on the same path.
Let me break it down a little further. I basically want to make a game slightly similar to Temple Run type endless runners, however it's on a track instead of dynamically generated environments, and it's not endless. I do want the ability to shift from the middle of the track to the inside or outside lanes though.
The implementation for this has not been too clear to me since it can't be fully rail-driven, meaning I can't use iTween (Tried that already) because I want the player to be able to jump and slide, as well as move from center to left or right.
I have tried a few different ways of attempting this but nothing has worked out how I like it so far. I've tried using iTween paths, I've tried using triggers to tell the character when to begin rotating at a certain interval while still running forward, until the character hits another trigger to stop the rotation (Going from running on the straight part of the track, to the 180 degree corner).
If anyone has any advice, or have done a similar implementation for a game they've worked on in the past, please let me know if you can help me. I'd greatly appreciate it!
All I need to establish is how the character will run consistently on the path, with user control, but always running forward. The other parts of the game will fall into place after that.
Thanks!
what is it supposed to do that it doesn't? (this feels like you are asking for the whole thing)
what does the user control? (do they get to deter$$anonymous$$e the lane they are in, the rate they turn, how fast they move?)
what have the implementation you have tried been missing?
if the player has "control" then why not just have the player just control staying on the path?
transform.rotate()
What it's suppose to do is go around the track (on it's own), constantly running forward, which is the issue I'm having..Hence the question.
If the user control wasn't clearly defined, basically, the user controls only left, right, up, down input. Left meaning moving from the right side of track to center or center of track to the left side. Same with Right input. Up and down input would be for Jumping (over hurdles or obstacles of some sort) and down would be for ducking, or sliding under obstacles.
They get to deter$$anonymous$$e the lane they are in by the left, right input. They don't deter$$anonymous$$e the rate they turn. That is driven by the path (which this question is posing), and how fast they move is deter$$anonymous$$ed by the progress (distance) they have traveled.
The implementations I've tried have been missing a few things.
With iTween, I'm restricted and can't implement the jumping/sliding mechanics, and the constant rotation implementation was too inaccurate and overtime causes the player to run a slightly different path each lap.
To answer the last bullet, they have "semi-control", not full control. They don't control the running, so the player doesn't control staying on the path themselves because of it.
Your answer
Follow this Question
Related Questions
Move an object toward an angle in 2d space 0 Answers
Syncing Position and Rotation data in ECS tests? 0 Answers
Rotating Camera around player object 0 Answers