Character bounces after changing position

/e 2: The bouncing apparently was caused by overlapping materials/shapes even though they were completely flat and the same height. Thanks to the snapping tool I got rid of the overlaps and now the ball rolls smooth!

Hello :slight_smile:

I’m currently expanding a little on the Tutorial 1, in which you create a rolling ball game.
I’ve created a “Teleporter”. When the ball enters a Trigger zone, the ball’s position on the Z plane gets changed. The Ball’s X, Y position and rotation all remain unchanged.

After the ball’s position gets adjusted via this “Teleporter” he 7 out of 10 times bounces off the ground after continuing to roll a short while or starts to bounce immediately after the position change and I can’t figure out why he randomly starts bouncing.

The Y plane is level, it’s a flat surface and the same height at both positions.

Any ideas why the bouncing occurs? I have tried minimally adjusting the Y position because I thought perhaps the problem has something to do with friction but no luck with that approach either.

/e: perhaps I should mention that I use the standard gravity, friction etc. settings and the ball enters the “teleporter” usually at a “medium” speed.
The ground has no physics material applied to it.

Here’s the relevant code if that helps:

else if (other.gameObject.name == "TeleportSouth"){
TeleportToPosition1 ();}

void TeleportToPosition1 (){
float currentpositionx = gameObject.transform.position.x;
float currentpositiony = gameObject.transform.position.y;
Vector3 teleportPosition1 = new Vector3 (currentpositionx, currentpositiony, -50.0f);
rigidbody.position = (teleportPosition1);
rigidbody.rotation = (Quaternion.identity);}

void OnTriggerEnter(Collider other){
if(other.gameObject.tag.Equals(“TeleportSouth”)){
TeleportToPosition1();
}
}

void TeleportToPosition1(){
  float currPosX = transform.position.x;
  float currPosY = transform.posdition.y;

  Vector3 telePos1 = new Vector3(currPosX,currPosY-0.5f, -50f);

  transform.position = telePos1;
}

This is untested and just slightly adjusted, maybe it works like this.
It’s a good thing to use Tags instead of Names.

This script requieres to be on the Ball, I don’t know where the Script is attached to.

If you don’t want the Ball to just pop out on the other Position, you could also use

transform.position = Vector3.Lerp(transform.position,telePos1,5f);

I hope that helps a little bit.