Hi there,
I cannot seem to get game objects to bounce off walls the way I want them too. The walls have a boxcollider2d and BouncyBox physics material. The Objects (blue Squares) have a boxcollider2d and rigidbody2d on them, gravity set to 0.
The objects are spawned at random from the top of the screens with a movement script attached to them.
rb.velocity = new Vector2 (1,-y);
currently this is what happens
Whereas I need each box to move more freely bouncing from wall to wall before going off the bottom of the screen. Like the this,
Hi! Is the movement script an Updated function? Or just want it starting? Y tried with this script, it just gets an object between to edge colliders, cero gravity to bounce between the two colliders.
public GameObject c;
private Rigidbody2D test;
// Use this for initialization
void Start ()
{
test = c.GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update ()
{
test.AddForce (Vector2.right);
}
And also changed the bouncy configuration of the material. To do this just double click the material and input some value in bounciness.