using UnityEngine; using UnityEngine.Assertions; [RequireComponent(typeof(Collider))] public class Projectile : MonoBehaviour { [SerializeField, Range(0f, 1f)] private float bounciness = 0.5f; private Collider projCol; private void Awake() { projCol = GetComponent(); Assert.IsNotNull(projCol); PhysicMaterial pMat = new(); pMat.bounciness = this.bounciness; projCol.material = pMat; } }