Hi everyone!
I´m creating a basic pong to understand the bases of unity. My question is:
At the moment the ball collides with the player (object), this increase your speed, but there comes a time when the very is very fast and the ball tranfer the body object instead of bouncing, so
Can the speed transfer to the object or do I have a collision error?
How can I make the ball bounce?
This is start metod:
public void Start()
{
Time.timeScale = 1f;
vel = 1f;
panel.gameObject.SetActive(false);
gol = GetComponent<Rigidbody>();
posbola1 = transform.position;
gol.velocity = new Vector3(x * vel, 0, z * vel);
}
increase the speed:
private void OnCollisionEnter(Collision collision)
{
if(collision.gameObject.tag== "raya") {
vel = vel +0.5f ;
gol.velocity = gol.velocity * vel;
}
I hope you can help me.
Thank you!