c# - Unity 'score does not exist in the current context' -


so i'm trying make when touch coin (sprite, it's 2d game) gets destroyed , point up, problem is, says score not exist in current context.

unity error: (assets/_scripts/textscore.cs(11,61): error cs0103: name `score' not exist in current context)

code:

using unityengine;   using system.collections;   using unityengine.socialplatforms.impl;   using unityengine.ui;   using system.security.cryptography.x509certificates;   public class codesystem : monobehaviour {   // use initialization    void start () {     }     // update called once per frame    void update () {     }    int score = 0;    void oncollisionenter ( collider other )    {        debug.log("picked coin!");        if (tag == "coin")        {            debug.log("added score!");            score = score + 1;        }     } } 


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -