• 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
Question by jdwieber · May 15, 2012 at 07:00 PM · errorcontroller

third person controller script has an error on line 193 (bitwise or)

Hi,

I'm not really asking a question here (I apologize if I'm doing this wrong), just an FYI. I recently added the character controllers package to a project and was alerted of an error on line 193 of ThirdPersonController.js. It has a bitwise or (|) comparing two boolean variable where I believe it should be a logical or (|) Here are the code snippets. Before:

     // Pick speed modifier
     if (Input.GetKey (KeyCode.LeftShift) | Input.GetKey (KeyCode.RightShift))
     {
         targetSpeed *= runSpeed;
         _characterState = CharacterState.Running;
     }

After:

     // Pick speed modifier
     if (Input.GetKey (KeyCode.LeftShift) || Input.GetKey (KeyCode.RightShift))
     {
         targetSpeed *= runSpeed;
         _characterState = CharacterState.Running;
     }

Cheers

Comment

People who like this

0 Show 4
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 ozfive · May 15, 2012 at 08:09 PM 0
Share

A better way of doing this would be to ask in a question format on why something is a certain way and then answer the question yourself. Just for future reference. :)

avatar image Berenger · May 15, 2012 at 08:26 PM 0
Share

You should create a post on the forum for that I guess. Thanks anyway :)

avatar image ozfive · May 15, 2012 at 08:40 PM 0
Share

If you read the FAQ http://answers.unity3d.com/page/faq.html you would see that there is a certain format that is asked of you to adhere to. "It's also perfectly fine to ask and answer your own question, but please post just the question first, and then reply to it below with your answer."

avatar image jdwieber · May 15, 2012 at 09:26 PM 0
Share

Ok, thanks.

0 Replies

· Add your reply
  • Sort: 

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.

Update about the future of Unity Answers

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta later in June. Please note, we are aiming to set Unity Answers to read-only mode on the 31st of May in order to prepare for the final data migration.

For more information, please read our full announcement.

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

Compiler Error...Help Needed. 0 Answers

Error Code BCE0044 1 Answer

Error in script I haven't even opened 0 Answers

some scripting help 2 Answers

Mono Develop start 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