• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
-1
Question by Nc00le · Nov 08, 2012 at 03:41 AM · uce0001semicolonexpected

UCE0001 semicolon expected, please help

I am trying to make the player die upon contact with an object tagged "Monster" but I keep getting this error.

 var health = 1;
 
 var takeDamage : boolean;
 
 
 
 function OnTriggerEnter(other : Collider){
 
     if(other.tag == "Monster"){
 
         TakeDamage = true;
 
             }
 
         }
 
         
 
 function OnTriggerExit(other : Collider){
 
     if(other.tag == "Monster"){
 
         TakeDamage = false;
 
         }
 
     }
 
     
 
     function Update(){
 
         if(takeDamage){
 
             health -- 1;
 
             }
 
         if(health <=1){
 
         print("You are dead");
 
         health = 0;
 
         Destroy (gameObject);
 
         }
 
     }
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Eric5h5 · Nov 08, 2012 at 04:33 AM

You mean either health-- or health -= 1.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What am I missing? I already have the semicolon at the end.. 1 Answer

Assets/Scripts/scriptEnemy.js(24,35): UCE0001: ';' expected. Insert a semicolon at the end. 3 Answers

UCE0001: ';' expected. 2 Answers

js(9,31): UCE0001: ';' expected. Insert a semicolon at the end. 2 Answers

So my problem is that after I finished coding for my Maze I had gotten a simple error called "UCE0001: ';' expected. Insert a semicolon at the end." This here is my script and the error is on both Lines (9,15) and (10,15). 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges