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 Rydrako · Feb 23, 2013 at 07:15 PM · errorrigidbodyvector3velocitynormalized

Error on 'velocity = [Vector3].normalized'?

Hai guys! I'm getting a weird error I have never seen before:

 Assets/SpaceShooter/Scripts/AI_BehaviorScripts/BombScript.js(27,92): BCE0044: unexpected char: 0xAD.

On the line:

 velocity = moveDirection.normalized * speed­;

Here's the whole script:

 var speed = 5;
 var rotateSpeed = 50;
 
 var maxScanning = 40;
 var blastRadius = 10;
 
 var explosionPrefab : Transform;
 
 private var follow = false;
 private var target : Transform;
 
 function Update () 
 {
         if(follow)
         {
                 var t : Vector3 = target.transform.position;
                 var moveDirection : Vector3 = t - transform.position;
                     
                 var velocity = rigidbody.velocity;
                     
                 if(moveDirection.magnitude<1)
                 {    
                         velocity = Vector3.zero;
                 }    
                 else
                 {    
                         velocity = moveDirection.normalized * speed­;
                 }    
                 
                 rigidbody.velocity = velocity;
         }
         else
         {
                 transform.Rotate(0,rotateSpeed*Time.deltaTime,0);
         }
         
         var hit : RaycastHit;
         
         var direction = transform.TransformDirection (Vector3.forward);
         
         if (Physics.Raycast (transform.position, direction, hit, maxScanning))
         {
                 if(hit.collider.tag == "Player")
                 {
                         follow = true;
                         target = hit.collider.transform;
                         if(hit.distance < blastRadius)
                         {
                                 //blow up and hurt the player
                                 Destroy(gameObject);
                                 var exp = Instantiate(explosionPrefab, transform.position, Quaternion.identity);
                                 //this enemy is only in multiplayer
                         }
                 }
                 else
                 {
                         follow = false;
                 }
            }
 }

Anyone know what's going on with it?!

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

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

Answer by Owen-Reynolds · Feb 23, 2013 at 09:11 PM

Character code 0xAD isn't a proper letter. In the old days, you often got hidden, unprintable junk in your lines. In fact, cheap software protection was to name part of your program "co^w^ol^a^Ga^ume". It displayed as "coolGame," but you couldn't type the name to copy it.

Way, way back then, the fix was to completely delete the line (which deleted the invisible junk) and retype it. I haven't seen that error in a long time -- modern editors don't let you enter junk values -- but if you pasted from some oddball source, maybe.

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 Rydrako · Feb 24, 2013 at 02:42 PM 0
Share

Oh wow! I did pasted this from a youtube comment! So I just delete the line, save and retype it?

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

10 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

Related Questions

rigidbody.velocity.normalized application 1 Answer

Velocity powered rigidbody on a moving platform without parenting. 3 Answers

error CS0122: `CharacterMotorC.SetVelocity(UnityEngine.Vector3)' is inaccessible due to its protection level 1 Answer

2d game - looking toward velocity for rigidbody player 1 Answer

Rigid Body Velocity max 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