Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
-3
Question by TheFluffyMaster · Jul 14, 2013 at 08:28 PM · javascriptbce0044batcheof

Unity EOF error!

i am working on a unity game and the really anoying error keeps coming up! the error is Assets/Melee_System.js(4,23): BCE0044: expecting EOF, found '1.5'.

here is my code

 #pragma strict
 
 var Damage : int; 50;
 var Distance : float; 1.5 
 
 
 :melee
 if input GetMouseButtonDown goto raycast;
 
 :raycast
 Raycast, Raycast.distance, goto damage;
 
 :damage
 if Raycast.distance, Damage;

can sombody please help me?

Comment
Add comment · Show 8
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
avatar image TheFluffyMaster · Jul 14, 2013 at 08:22 PM 0
Share

How do you Format a code?

avatar image InfiniBuzz · Jul 14, 2013 at 08:31 PM 0
Share

I formatted for you. You can do this using the "101010" button. btw what is this

avatar image Slobdell · Jul 14, 2013 at 08:33 PM 0
Share

Did something get lost in the formatting? This doesn't even look like code...

avatar image Kiloblargh · Jul 14, 2013 at 08:42 PM 0
Share

What program$$anonymous$$g language is that even supposed to be?

You can't just make up your own syntax as you go and expect the compiler to figure it out.

avatar image Eric5h5 · Jul 14, 2013 at 09:04 PM 2
Share

It's Fluffy$$anonymous$$asterScript, version 1.0. No idea why Unity doesn't support it.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Kiloblargh · Jul 14, 2013 at 09:03 PM

 #pragma strict
 var damage : int = 50;
 var distance : float = 1.5; 
 
 function Melee()
 {
 if (Input.GetMouseButtonDown(0))
     {
     RayCast();
     }
 }
  
 function RayCast ()
     {
     var hit : RaycastHit;
     if (Physics.Raycast (Camera.main.ScreenPointToRay (Input.mousePosition), hit, distance ) )
         {
         Damage (hit.distance);
         }
     }
 
 function Damage (rayDistance : float)
     {
     Debug.Log (damage / rayDistance+"This wasn't going to do anything anyway.");
     }

Here is my best attempt at translating the pseudocode you posted from facepalm to unityJS.

I advise you put aside Unity for a few months and just learn how to write a script the right way.

("EOF expected" means the compiler was telling you; "just stop already!")

Comment
Add comment · Show 1 · 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
avatar image TheFluffyMaster · Jul 15, 2013 at 03:16 PM 0
Share

Thank you $$anonymous$$iloblargh it helped a lot! ☺

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.

Follow this Question

Answers Answers and Comments

19 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Error BCE0044 plz help 0 Answers

sript gets error 2 Answers

expecting EOF, found 'showOptions' 1 Answer

BCE0044: expecting EOF, found }` error In my scripy 2 Answers

Javascript Expecting Errors ';' & '=' 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges