- Home /
2D endless runner ground problems
So, I have a player which runs at an increasing speed. I use a box collider for the player same for the ground.
My problem is that the player will get stuck in the ground at a specific point ( and if I get past it using jump it will get stuck at another specific point), always the same spots.
Depending on the speed I give to the player, the points where it gets stuck change.
I tried using a circle at his feet, but he starts bouncing ( very lightly) randomly. My player has continuous collision detection, though I tried with discrete and doesn't change anything.
I generate ground by cloning one game object over and over again, and moving it by the width of the ground to right, up until a point.
if (transform.position.x < PointGenerator.position.x)
{
transform.position= new Vector3((transform.position.x + GroundWidth), transform.position.y, 0);
Ground = (GameObject) Instantiate(Ground, transform.position, transform.rotation);
}
After letting it run for a good amount of time, it didn't generate any gap between the objects and it had the same axis X distance as it should have between any 2 object.
I couldn't find any solution on the internet. I would be very grateful if you could help me out.
Answer by Aggrojag · Nov 29, 2015 at 07:02 PM
The bouncing using the circle collider makes me believe that your y values are offset. A circle collider shouldn't bounce on a flat surface.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Internal Compiler Error for an Endless Runner Game? 1 Answer
Items not destroying. 1 Answer
4 C# errors Endless Runner 0 Answers