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
0
Question by pigi5 · Jan 21, 2011 at 05:02 AM · errorvector2bce0044declarationeof

Errors in Vector2 variables

For reasons unknown to me, I am getting these errors in my script :

  • expecting ), found ','
  • ';' expected. Insert a semicolon at the end
  • expecting EOF, found '1' or expecting EOF, found '8'

I found these on both lines declaring Vector2 variables, and in setting them, according to these errors, it seems that it won't take two numbers to set a Vector2 variable. Why is this happening? For context purposes, here is my entire script:

var camera1 : Camera; var camera2 : Camera; var camera3 : Camera; var openButton : Texture2D; var closeButton : Texture2D; var mapMarker : Texture2D; var compass : Texture2D; var mapSkin : GUISkin; var characterTransform : Transform; var screenPos : Vector3; var playerDirection : Vector2 = (0, 1); //this line is one problem var deltaRotation : float = 0; var pivotPoint : Vector2 = (0.898, 8); //this line is the other problem

function Update () { if (camera2.enabled) { screenPos = camera.WorldToScreenPoint (characterTransform.position); } }

function OnGUI() { GUI.skin = mapSkin; if (camera1.enabled) { deltaRotation = Vector2.Angle(playerDirection,Vector2(characterTransform.forward.x, characterTransform.forward.z));
GUIUtility.RotateAroundPivot(deltaRotation,pivotPoint);
playerDirection = Vector2(characterTransform.forward.x, characterTransform.forward.z);
GUI.DrawTexture(Rect(1145,3,290,290),compass); if (GUI.Button(new Rect(1115,270,50,50),openButton)) { camera1.enabled = false; camera2.enabled = true; camera3.enabled = false; } } if (camera2.enabled) { GUI.DrawTexture(Rect(screenPos.x - 12,730 - screenPos.y,20,20),mapMarker); if (GUI.Button(new Rect(1250,100,100,100),closeButton)) { camera1.enabled = true; camera2.enabled = false; camera3.enabled = true; } } }

function Start () { camera2.enabled = false; }

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 Eric5h5 · Jan 21, 2011 at 05:08 AM

That's not how you define Vector2s.

var playerDirection = Vector2(0, 1);
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 pigi5 · Jan 21, 2011 at 10:40 PM 0
Share

thank you so much, I had asked another question, and in someone's response, the person had defined them like that, so I assumed it was correct.

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

No one has followed this question yet.

Related Questions

Error BCE0044 plz help 0 Answers

EOF what does it mean? 3 Answers

BCE0044: expecting EOF, found }` error In my scripy 2 Answers

Please help, syntax error woe 2 Answers

Gun recoil/hitback animation problem 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