Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to assign 2d physics material through script

public PhysicsMaterial2D mat;

GetComponent<Collider2D>().sharedMaterial = mat; // Sets material to mat
 
PREVIOUS NEXT
Tagged: #assign #physics #material #script
ADD COMMENT
Topic
Name
6+7 =