Complete the code to create a new Physics Material with a bounce of 0.5.
PhysicsMaterial2D material = new PhysicsMaterial2D();
material.bounciness = [1];The bounciness property sets how much the material bounces. A value of 0.5 means it bounces back halfway.
Complete the code to assign a Physics Material with friction 0.3 to a Collider2D component.
PhysicsMaterial2D mat = new PhysicsMaterial2D();
mat.friction = [1];
Collider2D col = gameObject.GetComponent<Collider2D>();
col.sharedMaterial = mat;The friction property controls how much the surface resists sliding. 0.3 is a moderate friction value.
Fix the error in the code to correctly set the bounce combine mode to 'Multiply'.
PhysicsMaterial2D mat = new PhysicsMaterial2D();
mat.bounceCombine = [1];The bounceCombine property defines how bounce values combine. 'Multiply' multiplies the bounciness of colliding materials.
Fill both blanks to create a Physics Material with friction 0.6 and friction combine mode set to 'Minimum'.
PhysicsMaterial2D mat = new PhysicsMaterial2D(); mat.friction = [1]; mat.frictionCombine = [2];
Set friction to 0.6 for moderate friction and frictionCombine to 'Minimum' to use the smallest friction value when colliding.
Fill all three blanks to create a Physics Material with bounce 0.8, bounce combine mode 'Maximum', and friction 0.4.
PhysicsMaterial2D mat = new PhysicsMaterial2D(); mat.bounciness = [1]; mat.bounceCombine = [2]; mat.friction = [3];
Set bounciness to 0.8 for high bounce, bounceCombine to 'Maximum' to use the highest bounce on collision, and friction to 0.4 for moderate friction.