Search Unity

Unexpected charecters!

Discussion in 'Scripting' started by Pheonixx, Apr 20, 2014.

  1. Pheonixx

    Pheonixx

    Joined:
    Apr 19, 2014
    Posts:
    8
    I was using this script for this game I was making and no matter what I tried, it always came up with this error
    Assets/scripts/stomp.js(3,17): BCE0044: unexpected char: 0x201c

    This is my script.
    #pragma strict
    function OnTriggerEnter(other : Collider){
    if(other.tag == “Player”){
    transform.root.gameObject.GetComponent(Enemy).stomp = true;
    }
    }

    Its nothing complex.

    It says that there is a problem with
    Line:4
    Char:4
    Error: Invalid charecter
    Code:800A03F6
    Source: Microsoft JScript compilation error

    Can someone PLEASE help me?
    THANKS!
     
  2. Dameon_

    Dameon_

    Joined:
    Apr 11, 2014
    Posts:
    542
    First off, read the sticky post about code tags and how to use them.

    Second off, assuming this code is exactly as seen in your script, the problem would be that there's a space between stom and p in the 4th line.
     
  3. Pheonixx

    Pheonixx

    Joined:
    Apr 19, 2014
    Posts:
    8
    I did try the stom p thing but that didn't work. I got the same exact error.
    And what do you mean about sticky posts?
     
  4. wondyr

    wondyr

    Joined:
    Nov 30, 2013
    Posts:
    36
    Try removing the quotations marks from "Player"
     
  5. Pheonixx

    Pheonixx

    Joined:
    Apr 19, 2014
    Posts:
    8
    tried what you said wandyr but it didnt work.
    Is it a problem that I'm not using monodevelop though?
    I'm using notepad ++
     
  6. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    You have a space after "m" that should clearly not be there:
    Code (csharp):
    1. stom p[CODE]
     
  7. Pheonixx

    Pheonixx

    Joined:
    Apr 19, 2014
    Posts:
    8
    ik
    I tried fixing that and it doesnt work
    do I have to use monodevelop though?
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You need to use double quotes " ", not left and right quotes “ ”.

    --Eric