i need to change a variable in a script on another game object
var CurAmmo:int;
var theclip:Transform;
var clipscrip :Component;
function OnCollisionEnter(other:Collision){
theclip=other.transform;
clipscrip=theclip.GetComponent(clip);
CurAmmo=clipscrip.ammo;}
so far all is fine but when i do
function beAgun(){
clipscrip.ammo–;}
i get an error saying
Expression ‘self.clipscrip.ammo’ cannot be assigned to.
what a i doing wrong , thanks for the help