So right now this seems to be working for me but I wanted to check to see if it’s the best way to do this. I want to hit a kinematic rigidbody that tests the collisions to see if the relativeVelocity.magnitude reaches a high enough level to break the object and spawn pieces. If the check passes I want the collider to maintain its velocity after the collision with the kinematic rigidbody…so I’m doing that by directly changing the collider.velocity to the collision.relativeVelocity. Seems to work in my limited testing but I wanted to make sure there’s not a better way to do this.
Thanks in advance
var ShaperBlockPrefab : Transform;
function OnCollisionEnter(collision : Collision) {
if (collision.relativeVelocity.magnitude > 100){
var spawnPoint : Vector3 = Vector3(transform.position.x, transform.position.y -18, transform.position.z);
Instantiate (ShaperBlockPrefab, spawnPoint, transform.rotation);
collision.collider.rigidbody.velocity = collision.relativeVelocity;
Destroy(gameObject);
}
}