Problem accessing other GameObjects

I’ve done this before but it was a while ago and I don’t quite remember how to do it, here is my code, I made sure it was all set up right. The error I get is “Damage is not a member of UnityEngine.Component”. Thanks

function DamageBullet () {
if(shotBefore == true){
Bullet.GetComponent(BulletScript).Damage = BulletDamage;
}
}

i am noob, but will try help.

Damage is Function ?
if yes, add this:

Damage()

function DamageBullet () {
if(shotBefore == true){
Bullet.GetComponent(BulletScript).Damage() = BulletDamage;
}
}

No damage is a variable that I want to set equal to whatever I need it to be. Thanks anyway.

Try making damage either public or static in the script that defines it.

it’s faster to use a Type like you have… but depending on how you have it set up you may need to use a String instead of the type.

function DamageBullet () {
if(shotBefore == true){
var Test : BulletScript = Test.GetComponent(BulletScript).Damage;
Test.Damage = BulletDamage;
}
}

[/quote]