Search Unity

Character building error

Discussion in 'Documentation' started by Thecruzer, Oct 27, 2017.

  1. Thecruzer

    Thecruzer

    Joined:
    Aug 20, 2017
    Posts:
    18
    I'm getting an error while trying to build a player character If someone could let me know what I did wrong and how to fix it. The problem is on the public string function.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class BaseCharacterClass
    {
    private string characterClassName;
    private string characterClassDiscription;
    //Stats
    private int strength;
    private int agility;
    private int wisdom;
    private int intellegence;
    private int charisma;
    private int commonsence;
    private int wit;
    private int charm;
    private int shrewd;
    private int dexterity;
    private int stamina;
    }
    public string characterClassName; { get; set; }
    public string characterClassDiscription; { get; set; }
    public int strength { get; set; }

    public int agility { get; set; }

    Here is the error code:
    Assets/Scripts/BaseCharacterClass/BaseCharacterClass.cs(22,11): error CS1525: Unexpected symbol `string', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
     
  2. don_unity959

    don_unity959

    Unity Technologies

    Joined:
    Oct 19, 2017
    Posts:
    8
    It appears you have spurious semicolons in lines 21 and 22.
     
  3. Thecruzer

    Thecruzer

    Joined:
    Aug 20, 2017
    Posts:
    18
    Even taking off the semicolon from behind the words Name and Discription still comes up with the same error.