Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Script error (5,0) cs 1525 unxpected symbol 'public'

Discussion in 'Scripting' started by hanno21, Mar 4, 2018.

  1. hanno21

    hanno21

    Joined:
    Mar 2, 2018
    Posts:
    2
    I was to trying to follow the survival inventory got it all in their seems to to error in the script but cant find out the issus. Prohaps someone point them out.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    Public class Inventory : MonoBehaviour
    {

    //variables
    Public bool InventoryEnabled;
    Public GameObject Inventory;
    Public GameObject itemDatabase;




    //Functions
    Public void Start()
    {

    }

    Public void Update()
    {
    //Enabling and disableing the Inventory
    if (Input.GetKeyDown(keycode.1);
    InventoryEnabled = !InventoryEnabled;

    if (InventoryEnabled)
    Inventory.SetAcive(True);
    else
    Inventory.SetActive(Fasle);
    }

    }
     
  2. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Should be 'public' with lowercase p's.
     
  3. carl010010

    carl010010

    Joined:
    Jul 14, 2010
    Posts:
    139
  4. hanno21

    hanno21

    Joined:
    Mar 2, 2018
    Posts:
    2
    Ok thanks will try that. By the way whats this code thing never heard f it. just started usin unity the other day. been use renp'y so kinda know basic scripting.
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,982
    Click the link that @carl010010 gave you.