using RayFire; using UnityEngine; public class Bullet : MonoBehaviour { public float hitForcePercent = .5f; private int hitLimit = 1; private void OnCollisionEnter(Collision collision) { var rigd = collision.gameObject.GetComponent(); if (rigd == null) return; if (collision.gameObject.GetComponent().sharedMesh.name != "Cube") return; rigd.physics.velocity = this.GetComponent().velocity * hitForcePercent; rigd.Demolish(); } }