Unexpected behavior from bouncing sphere

Hi, I’m playing around with some physics in unity. I’ve created a sphere and I am using the AddForce on it to move it along the x and y axis like so:

    void Start () {
        position = transform.position;
        ball = GetComponent<Rigidbody>();
        ball.AddForce(transform.right * xForce);
        ball.AddForce(transform.up * yForce);
	}

Once the ball hits the ground and starts bouncing, it’s like a force is added to it on the z axis. You can see the behavior here: Screen capture - aa80b05e0129c00dc925d1dc7891715c - Gyazo

I don’t understand why this is happening. I wanted to the ball to bounce straight towards the red cube. Can anyone explain? I don’t know if it matters, but I have 0 dynamic, 0 static, 0 bounciness physic material on my terrain and 0, 0, 0.8 on my ball.

I am not sure what is going on. But try using Vector3.right and Vector3.up.

From Unity Docs:

Unlike Vector3.up, Transform.up moves the GameObject while also considering its rotation.

I am not sure why this would make a difference in your case but let us know if it works :).

***Update:
Solved (probably). This took a lot of research for what seemed like a simple problem. Even a smooth terrain is made up of a bunch of triangles. I am guessing the ball is interacting with the seams.
Settings>Physics>Default Contact Offset = 0.5 (default is 0.01) fixes this problem for me. I am not sure what repercussions there may be later in your development of your game though! Good luck and hope this helps.