Do you know about colliders and triggers? Try putting a a collider on the paddles and the ball, then check "is trigger". I'm not sure if this will work. You'll have to add a tag to each of the paddles.
`using UnityEngine;
using System.Collections;
public class Collider : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
if (other gameObject.tag == "Paddle")
{
rigidbody.AddForce(10, 10, 0);
}
}
}`
↧