Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
This question was closed Jan 09, 2016 at 09:26 PM by Le-Pampelmuse for the following reason:

Question is off-topic or not relevant

avatar image
0
Question by Gaming Worlds · Dec 21, 2015 at 11:17 PM · scripting problemerror messagerigidbody2d

I get error CS0119 and I don't know why?

I keep getting error CS0119: Expression denotes a 'type', where a variable, value, or method group was expected when writing this script. Any help would be appreciated. This is for line 13 of the code

     void FixedUpdate ()
     {
         if (dead) 
         {
             return;
             GetComponent<Rigidbody2D> ().AddForce (Vector2.up * upSpeed);
             didFlap = false;
         }
         if (GetComponent< Rigidbody2D> ().velocity.y > 0) {
             transform.rotation = Quaternion.Euler (0, 0, 0);
         } else 
         {
             float angle = Vector3(Mathf.Lerp (0, -90, (-Rigidbody2D.velocity.y / 3f)));
                 transform.rotation = Quaternion.Euler(0,0, angle);
         }
     }
 
     void OnCollisionEnter2D(Collision collision)
     {
         if (godMode)
             return;
         GetComponent<Animator>() .SetTrigger ("Death");
         dead = true;
         deathCooldown = 0.5f;
     }
 
 }
 



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

  • Sort: 
avatar image
1
Best Answer

Answer by Firedan1176 · Dec 22, 2015 at 01:32 AM

You've got Vector3, but you're not declaring that as a new Vector3. Even if you replace Vector3 with new Vector3, it should not work because float and Vector3 are not the same data types.

I think you're looking for: Vector3.Angle();

But still, you'll need to pass in 2 Vector3's, not just 1. I'm not entirely sure what you want to do, so if you could describe what you are wanting to happen, I could possibly help you better! Good luck.

Comment
Add comment · 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

Follow this Question

Answers Answers and Comments

35 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Manually created gravity too powerful 0 Answers

Help with Error Code CS0019 2 Answers

All compiler errors have to be fixed, but I copy pasted the code from the tutorial roll a ball to ensure its right. It still gives me the error! 0 Answers

Object reference not set to an instance of an object (c#) 0 Answers

ERROR Loading Script! WHAT'S WRONG?? 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