- Home /
Question by
amr mosallem · Apr 20, 2014 at 11:36 PM ·
fixthiscannoti
error CS0103: The name `FiredShot' does not exist in the current context
using UnityEngine;
using System.Collections;
public class playerGun : MonoBehaviour {
public GameObject Ammo; // theShot
GameObject FiredSHot; //shot in air
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Input.GetKeyDown(KeyCode.Mouse0)){
FiredShot = (GameObject)Instantiate(Ammo, transform.position, Quaternion.identity) ;
}
if( FiredShot != null ){
firedShot.transform.position += Transform.forward * 15 * Time.deltaTime;
}
}
}
Comment
Answer by robertbu · Apr 20, 2014 at 11:38 PM
You've misspelled 'FireShot' on line 9. Notice the upper case 'H'. Spelling and case must match exactly. Also, by convention, variables should start with a lower case letter. Classes and Methods should start with an upper case letter.
Answer by amr mosallem · Apr 22, 2014 at 11:46 PM
but, I write
" error CS0103: The name `FiredShot' does not exist in the current context"
I said "FiredShot" not "FiredSHot"