I've just started looking into developing with Unity, and read through the tutorials and introductions. For my first project, I decided to try something simple - so a breakout clone. However, when the ball hits the player, the player gets knocked down a few pixels.
The player and ball have BoxCollider2D attached to them, and the player also has a RigidBody2D attached to it. The player is also checked as a "static" object. The ball moves towards the player using transform.translate().
Here is the balls script:
using UnityEngine;
using System.Collections;
public class BallScript : MonoBehaviour {
public float speed;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
this.transform.Translate (Vector3.down * speed * Time.deltaTime);
}
void OnCollisionEnter2D (Collision2D col) {
this.speed = -speed;
}
}