I have looked around but haven’t found anything that helped me quite yet, just for a test I made a scene with a camera that shot a cube at a wall. What I want to test is that after a couple hits the wall should disappear/break. Here’s what I had on the bullet so far, I need a way to transfer the values from this script to my wall/playerproperties script.
Bulletcollision.js:
var damage = 5;
function OnCollisionEnter(theCollision : Collision){
if(theCollision.gameObject.name == "Wall"){
}
Playerproperties:
var health=20;
function Update()
{
if (health <= 0)
destroy(gameObject);
}