• 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 /
avatar image
0
Question by skovarovic · Feb 28, 2016 at 10:52 AM · script error

Need help with 4 scripting errors

Need help with scripting errors. I'm creating a game for school, and I'm more of an animator. Its a 2D fighter.

  1. Unity is stating void start is an error because of void. if I delete void, it still gives an error, if I delete the line I still get an error. Not sure what I'm doing wrong

// Use this for initialization

void Start()

     void Update()

     {
     AttackInput ();
     ScaleCheck();
     OnGroundCheck();
     Damage();
     UpdateAnimator();
     }

  1. Unity is stating float is an error, if I remove float it creates jmpduration as error, and creates additional errors.

public float JumpForce = 20; public float jumpDuration = .1f float jmpduration float jmpforce; bool jumpKey; bool falling; bool onGround;

  1. repeats same error above?

  2. Unity states unexpected symbol {

public class DamageScript : MonoBehaviour { void OnTriggerEnter2D(Collider2d col) { if(col.transform.root != transform.root && col.tag != "Ground" && !col.isTrigger) { < MARKED UNEXPECTED if(!col.transform.GetComponent().damage { col.transform.GetComponent().damage = true;

                 col.transform.root.GetComponentInChildren<Animator>().SetTrigger("Damage");
             }
         
             }
             }
         

Can anyone help me fix these?

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 tanoshimi · Feb 28, 2016 at 10:57 AM 2
Share

If you need help with a school project, you should really ask your $$anonymous$$cher. I'm not trying to be obtuse - I'm a lecturer in game development myself - your $$anonymous$$cher needs to know when you get stuck so that they can help you, but also to help them know that perhaps they didn't explain that bit of the course material well enough.

Note that none of your problems are specific to Unity - they're all general program$$anonymous$$g mistakes you've made either through lack of attention to detail or lack of understanding. The most useful skill your $$anonymous$$cher can give you is how to interpret those error messages so you can fix future problems on your own.

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

transformers script error 1 Answer

After converting c# Script, Unity is giving errors on multiple lines which were fine before. 0 Answers

Simple script error 1 Answer

Hi, I have two errors. I am sorry everyone but I am going crazy 1 Answer

Assets/Controller/Character Controller.cs(4,33): error CS8025: Parsing error 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