Plane to Plane Transition.

Hello Unity Community,

I am a newcomer to Unity. I have completed the Roll-a-Ball tutorial and am expanding on this for practice. However I have encountered a problem when the player transitions from plane to plane.
For some reason with my 2 planes scaled and positioned exactly the same on the Y axis there is a “bump”
in the transition area when the ball rolls over the joining section. Can anybody give me some pointers here or explain to me why this happens. I can present the file for inspection if needed.

This is also my first post on the forum so if it is in the wrong location I apologize in advance.

Hi,

I’ve never did a Roll-a-Ball tutorial. Can you post a script using valid tags?
BTW Next time if you have any issues create a thread on a “Scripting” section.

I dont think my problem is the scripting, simply the in game “Plane to Plane” transition is not smooth as I thought it should be. Just in case here is the script that controlls the player (Sphere)

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour {

public float speed;

void Update() {
float moveHorizontal = Input.GetAxis (“Horizontal”);
float moveVertical = Input.GetAxis (“Vertical”);

Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

rigidbody.AddForce (movement * speed * Time.deltaTime);
}
}

Don’t forget using code tags example code As code becomes more and more complex it’s almost impossible to read it on forums.

You were talking about “Plane to Plane” transition. What does that mean? I thought it was about switching levels.

He has two planes with the edges (at least theoretically) lined up perfectly, and is wondering why his ball when crossing that boundary “bumps” a bit instead of being a perfectly smooth transition.

My guess, without seeing the project is to check the actual colliders. It is possible that even though the meshes are perfectly lined up that the colliders are not, either vertically(one slightly higher than the other) or horizontally, where they may be a slight gap in the colliders.

I don’t see anything specifically wrong in the script, though I’m not very practiced yet.

1 Like

here is a link to a video description of the problem

it may be a mesh problem

Try to make second plane lower (the small plane) than the first one (the large plane) by at least 0.5 or 0.1. It won’t be perfect, but it should do the trick.

I see you increased the size of your suggestion distance. Maybe I’m wrong, but wouldn’t that create a bump directly that is worse than what he has? I’m not testing it, so maybe I’m wrong.

Another thing I can suggest, after testing elmar’s thing(since it is quicker than what i suggest) is to go from using mesh colliders to using actual plane colliders. They are simpler, faster, and it may or may not fix the problem too.

I will give it a go thnx for the input guys,
will let you know how it works out for me

Or maybe use cubes. That might work too.

1 Like

Something occurred to me. You could use one big plane/cube for the whole floor, since it is all flat, at least it looks flat in the video. It doesn’t matter if some of the floor collider is outside of the area because you have the walls that won’t let it get outside anyway.

1 Like