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 Richard 4 · Oct 01, 2010 at 12:40 AM · errorvector3syntax-errorinvokebce0077

HELP BCE0077: It is not possible to invoke an expression of type 'UnityEngine.Vector3'.

Hi everyone, this is my first time posting here and I was wondering if someone could help me fix a mistake in a line of code i am writing for my pool game. Ok so what i am trying to achieve is that when i click the gui button i made, the pool stick moves left relative to the player so as to aim up a spin shot. but when i try i get the error " BCE0077: It is not possible to invoke an expression of type 'UnityEngine.Vector3'. which i dont understand because i was able to achieve a rotation of the cue but not position. Here's my code and any help is greatly appreciated because i just started learning java script 1 week ago and i know no other languages.

var cue : Transform;
var rotateamount : float = .07;
var leftbuttonpositionx : float;
var leftbuttonpositiony : float;
var rightbuttonpositionx : float;
var rightbuttonpositiony : float;
var upbuttonpositionx : float;
var upbuttonpositiony : float;
var downbuttonpositionx : float;
var downbuttonpositiony : float;
function OnGUI () 
{
        if (GUI.Button (Rect (leftbuttonpositionx, leftbuttonpositiony, 100, 50), "Left Spin"))
        cue.transform.position (0, - (rotateamount), 0);
}

Right where I put "cue.transform.position" is the error which is where i get lost because if i substitute .position with .Rotate everything works fine as expected. I was under an impression that Rotation and position are of similar type. Are they of a different class? Thanx in advance, hope to here back.

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 Eric5h5 · Oct 01, 2010 at 01:40 AM 0
Share

Use the code button to format code, so it's readable.

1 Reply

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

Answer by Eric5h5 · Oct 01, 2010 at 01:41 AM

You have to set transform.position to a Vector3.

cue.transform.position = Vector3(0, - (rotateamount), 0);
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 Richard 4 · Oct 01, 2010 at 03:50 AM 0
Share

oh ok thank you very much erich5h5. that was very simple. thanks again.

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

1 Person is following this question.

avatar image

Related Questions

Unexpected token: .. 1 Answer

Gun recoil/hitback animation problem 1 Answer

How "include" the Raycast?! 1 Answer

Error "There is already a local variable with the name 'obstacle'." How can I make it work? 2 Answers

Scripting error: ';' expected. Insert a semicolon at the end. 2 Answers


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