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 question was closed Jul 30, 2013 at 01:32 AM by Drshk7 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Drshk7 · Sep 15, 2012 at 06:55 AM · unexpectedidentifierunknownchar

Unexpected char:0xFEFF and Unknown PlayerStateController?

Script for 0xFEFF:

 public var bulletPrefab : Transform;
 public var bulletSpeed : float = 6000;
 function Update () {
  if (Input.GetButtonDown("Fire1")) {
   if(!bulletPrefab || !bulletSpeed) {
    Debug.Log("[Shoot] 'bulletPrefab' or 'bulletSpeed'is undefined");
     } else {
      var bulletCreate = Instantiate(bulletPrefab, GameObject.Find("Spawnpoint").­transform.position, Quaternion.identity);
       bulletCreate.rigidbody.AddForc­e(transform * bulletSpeed);
             }
            }
           }  

And here's the script for Unknown Identifier:

 function Update ()
 {
 
 PlayerStateContoller();
 PlayerAnims();
 
 }
 
 function PlayerStateController()
 {
 if ((Input.GetAxis("Vertical") !=0 || Input.GetAxis("Horizontal") !=0))
 {
 if (Input.GetButton("Sprint")&&!Input.GetMouseButton(1))
 {
 PlayerState = 2;
 } 
 
 else if (Input.GetMouseButton(1) && !Input.GetButton("Sprint"))
 {
 PlayerState = 3;
 }
 else
 {
 PlayerState = 1;
 }
 
 }
 else
 if (!Input.GetMouseButton(1))
 {
 PlayerState = 0;
 }
 }
 
 function PlayerAnims()
 {
 if (PlayerState == 0)
 {
 PlayerAnimSec.animation.CrossFade("idleanim", 0.4);
 }
 else if (PlayerState == 1)
 {
 PlayerAnimSec.animation.CrossFade("walkanim", 0.4);
 }
 else if (PlayerState == 2)
 {
 PlayerAnimSec.animation.CrossFade("sprintanim", 0.4);
 }
 }

Thank you and please tell me specifically because I just began coding (and not good at it heh) Thanks

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

  • Sort: 
avatar image
1
Best Answer

Answer by Graham-Dunnett · Sep 15, 2012 at 09:59 PM

The byte order mark (BOM) is a Unicode character used to signal the endianness (byte order) of a text file or stream. It is encoded at U+FEFF byte order mark (BOM). BOM use is optional, and, if used, should appear at the start of the text stream. Beyond its specific use as a byte-order indicator, the BOM character may also indicate which of the several Unicode representations the text is encoded in. (Well, so says Wikipedia!)

Save your script as an ascii-encoded file, or instead as a utf-8 one. These are changes you will need to make in your text editor.

Comment
Add comment · Show 4 · 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 Drshk7 · Sep 16, 2012 at 01:37 AM 0
Share

It was utf-8. what any other solutions?

avatar image Nihltos85 Drshk7 · Apr 02, 2014 at 05:10 AM 0
Share

To me it was an ANSI type of format :S I was using Unity3D 4.3.2f1 at the moment.

Obviously not that same code but same error. For all those more than newbies just like me out there. Just copy the code in a .txt document and then save it as an ANSI format or any other that works for you. Then copy and paste in $$anonymous$$onoDevelop.

Any experienced programmer care to explain this error in common language XD, so we untrained monkeys can learn what's what. TY all.

avatar image Drshk7 · Sep 16, 2012 at 08:20 PM 0
Share

It was utf-8. what any other solutions? o and what do i do with the unknown identifier thanks

avatar image Bunny83 · Apr 02, 2014 at 05:52 AM 0
Share

@Nihltos85:
utf8 is a compact way to encode Unicode characters so they can be saved to a file / data stream / whatever. Different PC hardware-architectures uses different ways to store numbers which need more than one byte to be represented. This is called Endianness. The x86 compatible family for example uses the little-endian format. Since data (in the form of files or send via the internet) can be transferred to other systems It's difficult to deter$$anonymous$$e the right ordering. The BO$$anonymous$$ (Byte order mark) has been "invented" to tell a reading program how the data has been encoded. However this is not really a valid standard in Unicode. It's better to save the file as a simple ASCII or ANSI text where each character is exactly 1 byte. If Unicode is needed the file should be saved as "utf8 without BO$$anonymous$$" if available.

Follow this Question

Answers Answers and Comments

12 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

Related Questions

Error BCE0005: Unknown identifier: 'GetAxis'. 0 Answers

Error BCE0005: Unknown identifier: 'GetAxis'. 0 Answers

Float parse issue FormatException: Unknown char: - 0 Answers

Javascript literal error: unexpected identifier 1 Answer

how to fix unknown identifier? 1 Answer


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