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 /
  • Help Room /
avatar image
-1
Question by $$anonymous$$ · Mar 27, 2013 at 01:29 PM · function

Simple Question

Hi it's me again, with another question :)

i was wondering what these brackets after function Update or over functions are:

 function Update(//what can you do with these?!)
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

2 Replies

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

Answer by Karsnen_2 · Mar 27, 2013 at 01:44 PM

Ar asking about the angle"()" brackets followed after Update ?

That is just a protocol to define any method. It has been in existent since C and we have been following it in the subsequent programming languages. And Update is also a method which Unity call in for every Time.deltaTime.

If there is anything specific you want to know, let me know.

To throw a generic document about methods, here it is

Comment
Add comment · Show 5 · 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 $$anonymous$$ · Mar 27, 2013 at 01:55 PM 0
Share

so they are not neccessary?

avatar image Karsnen_2 · Mar 27, 2013 at 03:44 PM 0
Share

They are necessary... I would recommend to get the basics of C# well done before you could dip yourself into Unity. If not C# any other program$$anonymous$$g language.

avatar image $$anonymous$$ · Mar 31, 2013 at 10:28 AM 0
Share

I think i'll be okay with my javascript skills ( xD )

But if you have an other function... like

 function OnTriggerEnter(other:Collider) {}

you write something in these brackets... can you do something like that with the function Update brackets?

avatar image Karsnen_2 · Apr 03, 2013 at 03:24 PM 0
Share

Well no you can't.

avatar image $$anonymous$$ · Apr 03, 2013 at 07:22 PM 0
Share

okay, that was all i wanted to know :) thank you!

avatar image
0

Answer by murkantilism · Apr 03, 2013 at 07:45 PM

Those are parenthesis, not brackets.

{ } <-- These are brackets.

Parenthesis are used define methods, and invoke method calls. They are used to differentiate methods from other types of code. Example:

 int foo = 5;  // A variable named foo
 void foo(){   // A method named foo
     return "hello";
 }
 print foo   // This prints 5
 print foo() // This prints hello

As you can see in the example, brackets are used to define the body of the method. You can also insert arguements into the parenthesis of a methed, like this:

 // This takes a number as an argument and adds 1 to it
 void foo(aNumber){
     aNumber += 1;
 }

I highly suggest you familiarize yourself with basic programming techniques before doing anything in Unity. Otherwise you'll keep coming back here and flooding UnityAnswers with incredibly basic questions like this. Sorry but I have to downvote the question, it doesn't belong here. Google "basic programming" and do some tutorials.

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

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

11 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

Related Questions

How do you stop a function with another function? 2 Answers

OnMouseEnter is blinking 1 Answer

How to call functions from another script c# (Unity5) 1 Answer

GameJolt API simple Score 0 Answers

If statement noop :) 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