- Home /
Jumping player at platform connection
Hello! I'm programming a game like an endless runner. You control a cube and try to avoid obstacles. The player is frozen in Z-axis. Platform with a length of 15 with obstacles moves toward you in Z-axis with constant velocity. When the platform reaches an activation point the next platform is spawned behind the previous. The friction of a platform is set to 0. Player has rigidbody with enabled gravity. The problem is that when player detects the connection of platforms sometimes jumps to a low height what looks like a bug. I attach a video. https://drive.google.com/open?id=1BDP38UOuNlCA3rTeR1wHrgpOfoE88JgP Ask for details if needed. Thanks for all answers :)
Hey.. 1.Go To RigidBody Component and In Constrains Freeze The Position on Y-Axis.. 2.you can attach your physic material to your player too i think its because of physic system will try to combine the friction of 2 surface im not sure about this one so try and tell me.. 3-i think there is little difference in height of the 2 platform that gonna stick together and this difference will cause this issue .. check the position.y of the platform make sure they are on same level of height
I don't want to freeze Y-axis, because there is a jumping mechanics through obstacles.
I attached physics material to the player and still this same problem
All platforms are the same height of 1 and in position.y = 0 and I froze the X-axis and Y-axis. Thanks for your advice, but this didn't solve the problem. :c
what method you are using for making the player to move?
Answer by Magso · Dec 12, 2019 at 10:46 PM
The video doesn't really show much but for this behaviour it would be easier to use a CharacterController
for it's specific properties and functions such as isGrounded and Move(). A CharacterController
is similar to isKinematic
and will do exactly what you tell it like a static object but takes physics into consideration.
Answer by karol_2502 · Dec 13, 2019 at 02:11 PM
https://drive.google.com/open?id=12vr8NS1IcQ8zJOsT-QX2nTYyCpbkRws5 In this video, I show how the player movement looks like and platform move. I increased the space between the next spawning platform to better show how it looks. The player is static in Z-axis and only obstacles move toward him. You lose when you fall down of platform or hit an obstacle.