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 /
avatar image
1
Question by RobF · Feb 20, 2010 at 11:20 PM · editorscriptingbasics

Project Scripting - Tracking variables (General Question)

I'm a total newbie at scripting (and programming in general), am having no problems with the logical or procedural aspects of learning Javascript but am finding it extremely frustrating keeping track of which variables have been declared for which Object so I can call them from elsewhere.

Could some experienced programmer please point me in the right direction.

  • Is there an editor out there that will summarise the variables on a separate document?

Thank you in advance RobF

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
2
Best Answer

Answer by jashan · Feb 21, 2010 at 02:48 PM

I'd recommend dropping JavaScript, picking up C# and using Visual Studio. That gives you very nice Intellisense - so the editor knows all members (variables and methods) and when you type only the first few letters, you'll get a list to select from (or you can use a key combination to see all without even typing anything).

In these times, you don't type your variable/method names anymore - you just pick them from the list (usually what you do is type the first few characters and then hit tab). It's much faster than using an editor like Unitron and typing everything out.

Besides, if you are completely new to programming, I'd recommend learning the basics in actual programming tutorials (not Unity tutorials) because that'll give you a much better foundation in the long run. One good Unity/C# tutorial I can recommened (which covers the basics) is:

Programming with C# and Unity

Once you have a basic understanding of programming - converting that UnityScript stuff into C# is a nice warm up practice ;-)

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 RobF · Feb 22, 2010 at 06:43 AM 0
Share

That link you provided if very good, thanks Jashan. I've taken the advice and hence taken the leap to C#.

avatar image
1

Answer by fallingbrickwork · Feb 20, 2010 at 11:51 PM

I think the best advice I can give to beginners is a good starting structure and a naming convention... ie, don't call a position vector 'p' when you could call it 'playerPosition'. For me, I always think about how I will see things in 9-12 months time. When you are coding today you will know what is going on but when you come back in 9 months time to add functionality or fix a bug you'll be totally stumped to what is going on without a good coding structure.

That said, this comes with experience... my early projects would look horrendous now.

I also try and cut down on global variables (but i'm not sure everone would agree with that one).

I also try and not 'overlap' any GameObject variables... ie the Player Object only contains stuff that relates to that object. I mean I wouldn't process any GUI stuff or other GameObject stuff within those scripts, I'd send any data I need to the required scripts instead of having external script getting data.

Not sure about UnityScript(Javascript) but if you went down the C# route, Visual Studio has tracking stuff for classes etc so you can track variables and where they are used... also the intellisense is a great help (plus - if you are new to programming it's probably as easy to learn c# as Javascript).

Comment
Add comment · Show 3 · 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 RobF · Feb 21, 2010 at 01:07 AM 0
Share

I'm sure you're correct about the C# route, but it seems all the "full" tutorials available for Unity are Script based and the thought of adapting them to C# is rather daunting for this Newbie.

avatar image Sebas · Feb 21, 2010 at 03:03 AM 0
Share

Check the www.3dbuzz.com website or the following forum thread (http://forum.unity3d.com/viewtopic.php?t=39327&highlight=3dbuzz). Their "full" project is in C# which could help you getting started.

avatar image RobF · Feb 21, 2010 at 03:49 AM 0
Share

tks Sebas, now i'm running out of excuses :))

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

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How to make an GUILayout.Window draggable ? 3 Answers

Script that switches between first and third person controller 3 Answers

How to edit a enumerator in the editor? 2 Answers

How do I reference variables from one editor script in another 0 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