using SHADE; using System; public class PhysicsTest : Script { [SerializeField] [Tooltip("Force to apply when pressing Space.")] private Vector3 Force = new Vector3(0.0f, 1.0f, 0.0f); private RigidBody RigidBody; private Collider Collider; public PhysicsTest(GameObject gameObj) : base(gameObj) { } protected override void awake() { RigidBody = GetComponent(); if (RigidBody == null) { Debug.LogError("RigidBody is NULL!"); } Collider = GetComponent(); if (Collider == null) { Debug.LogError("Collider is NULL!"); } var subColider = Collider.ColliderBoundsCount; Debug.Log($"There are {subColider} colliders."); } protected override void update() { if (Input.GetKeyUp(Input.KeyCode.Space)) { RigidBody.AddForce(Force); } } }