- Home /
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
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. :)
You should create a post on the forum for that I guess. Thanks anyway :)
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."
Your answer
Follow this Question
Related Questions
Compiler Error...Help Needed. 0 Answers
Ending my game 3 Answers
Why is this player script not working 1 Answer
Debug.Log error 2 Answers
error in creating mesh script 0 Answers