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 /
avatar image
1
Question by Bruno-Fludzinski · Jun 15, 2012 at 10:18 PM · errorerror-handlinghelicopter

Helicopter script error

I'm making a Unity helicopter using this tutorial

http://www.gotow.net/andrew/wordpress/?page_id=99

and I have a good script going:

     var main_Rotor_GameObject  : GameObject;
 var tail_Rotor_GameObject  : GameObject;
 var max_Rotor_Force  : float = 22241.1081;
 var max_Rotor_Velocity  : float = 7200;
 static var         rotor_Velocity  : float = 0.0;
 private var  rotor_Rotation  : float = 0.0; 
 var  max_tail_Rotor_Force  : float = 15000.0; 
 var max_Tail_Rotor_Velocity  : float = 2200.0; 
 private var  tail_Rotor_Velocity  : float = 0.0; 
 private var  tail_Rotor_Rotation  : float = 0.0;
 var  forward_Rotor_Torque_Multiplier  : float = 0.5;
 var  sideways_Rotor_Torque_Multiplier : float = 0.5;
 static var          main_Rotor_Active : boolean = true;
 static var          tail_Rotor_Active : boolean = true;
 
 function FixedUpdate () {
 var torqueValue : Vector3;
 var controlTorque : Vector3 = Vector3( 
 Input.GetAxis( "Vertical" ) * forward_Rotor_Torque_Multiplier, 
 1.0,
 -Input.GetAxis( "Horizontal2" ) * sideways_Rotor_Torque_Multiplier
 );
 if ( main_Rotor_Active == true ) {
 torqueValue += (controlTorque * max_Rotor_Force * rotor_Velocity);
 rigidbody.AddRelativeForce( Vector3.up * max_Rotor_Force * rotor_Velocity );
 }
 if ( Vector3.Angle( Vector3.up, transform.up ) < 80 ) {
 transform.rotation = Quaternion.Slerp( transform.rotation,
 Quaternion.Euler( 0, transform.rotation.eulerAngles.y, 0 ),
 Time.deltaTime * rotor_Velocity * 2 );
 }
 if ( tail_Rotor_Active == true ) {
 torqueValue -= (Vector3.up * max_tail_Rotor_Force * tail_Rotor_Velocity);
 }
 rigidbody.AddRelativeTorque( torqueValue );
 function Update () {
 }
 if ( main_Rotor_Active == true ) {
 main_Rotor_GameObject.transform.rotation = transform.rotation * 
 Quaternion.Euler( 0, 
 rotor_Rotation,
 0
 );
 }
 if ( tail_Rotor_Active == true ) {
 tail_Rotor_GameObject.transform.rotation = transform.rotation * 
 Quaternion.Euler( tail_Rotor_Rotation,
 0,
 0
 );
 }
 rotor_Rotation += max_Rotor_Velocity * rotor_Velocity * Time.deltaTime;
 tail_Rotor_Rotation += max_Tail_Rotor_Velocity * rotor_Velocity * Time.deltaTime;
 var hover_Rotor_Velocity = (rigidbody.mass * Mathf.Abs( Physics.gravity.y )
 / max_Rotor_Force);
 var hover_Tail_Rotor_Velocity = (max_Rotor_Force * rotor_Velocity) 
 / max_tail_Rotor_Force;
 if ( Input.GetAxis( "Vertical2" ) != 0.0 ) {
 rotor_Velocity += Input.GetAxis( "Vertical2" ) * 0.001;
 }else{
 rotor_Velocity = Mathf.Lerp( rotor_Velocity, 
 hover_Rotor_Velocity, 
 Time.deltaTime * Time.deltaTime * 5
 );
 }
 tail_Rotor_Velocity = hover_Tail_Rotor_Velocity - Input.GetAxis( "Horizontal" );
 if ( rotor_Velocity > 1.0 ) {
 rotor_Velocity = 1.0;
 }else if ( rotor_Velocity < 0.0 ) {
 rotor_Velocity = 0.0;
 }
 }

And the error console says "Assets/Scripts/Helicopter_Script.js(3,24): BCE0044: unexpected char: 0xFB02." I really dont know what that means so any help would be great thanks

Comment
Add comment · Show 1
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 whydoidoit · Jun 15, 2012 at 10:20 PM 2
Share

Looks like you have a dodgy character in there somewhere. Presumably on line 3 in position 24 - it looks like a space here perhaps it isn't in your script.

1 Reply

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

Answer by Wolfram · Jun 15, 2012 at 10:48 PM

Heh, 0xFB02 is a special character for a ligature of "fl". And indeed, if you try to select just the "f" of "float" in line 3, you see you can't select it without also selecting the "l".

To answer your question, just delete the word "float" in line 3, and type it again.

EDIT: woops, all other "float"s have the same problem. Don't copy the code out of the .pdf, just download the project.

Comment
Add comment · Show 2 · 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 whydoidoit · Jun 15, 2012 at 10:50 PM 1
Share

Bloody good spot :) Do you just happen to know all of the Unicode characters by heart? In school they just taught me my times tables to 12.

avatar image Wolfram · Jun 15, 2012 at 10:51 PM 1
Share

Hehe, google is your friend ;-)

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

6 People are following this question.

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

Related Questions

GUI error scripting help! 2 Answers

Why is the script rejecting me? 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Official Unity Space Shooter Tutorial 1 Answer

'Cannot Submit Change to Server' and Failing to Revert Project in Unity Collab 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