Alright, so essentially what I’m looking for is when a bullet collides with another gameobject, it causes it to fall or be moveable again. For instance, a bullet hits a brick wall, turning off the kinematics of the bricks and pushing them inward to expose a hole for the player to walk through.
Here’s my current code:
var projectile : Rigidbody;
var speed = 20;
var rate : float = 0.5;
private var rate_time : float;
function Update()
{
if( Input.GetButtonDown("Fire1") && Time.time > rate_time)
{
rate_time = Time.time + rate;
var instantiatedProjectile : Rigidbody = Instantiate(projectile, transform.position, transform.rotation );
instantiatedProjectile.rigidbody.AddForce(instantiatedProjectile.transform.forward * speed);
Physics.IgnoreCollision( instantiatedProjectile. collider, transform.root.collider );
}
}
Any help with integrating the code into that or a better suggestion would be much appreciated!