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
1
Question by raven shield · Sep 02, 2013 at 06:48 AM · monodevelop

Simple Unity Coding...

Good day...

I am an intermediate programmer and having a problem on how to use Unity scripts... I would like to ask for your help just a simple one on how to programmaticaly:

  1. Create a 3D or call a 3D object during runtime.

  2. Control camera during runtime (3rd person).

That is all for now. I am planning to design a game and i hope that you can help me through it. I will just need a simple code and i will do the rest. I will post the final code here so that everyone can make reference on it on the future...

Thank you so much...

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

Answer by CHPedersen · Sep 02, 2013 at 06:51 AM

It's unclear what you mean by "Create a 3D or call a 3D object during runtime". Do you mean instantiate an object so it appears in the scene, and calling a method in a script attached to a gameobject?

As for camera control, please see the standard Character Controllers that comes with Unity, available through Assets->Import Package->Character Controller. It will import a rich package of available character controllers which includes camera movement. Study those examples.

Comment
Add comment · Show 2 · 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 raven shield · Sep 02, 2013 at 07:06 AM 0
Share

i mean GameObject... Is it possible to start it blank then you call all of the necessary GameObjects(Terrain, Character, etc..) when you run the game?

avatar image CHPedersen · Sep 02, 2013 at 07:10 AM 0
Share

Yes, certainly. You could have your entire game created solely from custom code and run off of a single GameObject with a single script serving as an access point, if you wanted to. But you have to have at least one GameObject.

avatar image
0

Answer by Imawizrd · Sep 02, 2013 at 06:57 AM

Create a 3D or call a 3D object during runtime.

http://docs.unity3d.com/Documentation/ScriptReference/GameObject.html

This is your "3D object" in Unity we call it a GameObject.

Read through this to learn how to create a GameObject during runtime: http://docs.unity3d.com/Documentation/ScriptReference/Object.Instantiate.html

This one finds a GameObject at run time:

http://docs.unity3d.com/Documentation/ScriptReference/GameObject.Find.html

Control camera during runtime (3rd person).

Using the Camera's Transform component http://docs.unity3d.com/Documentation/ScriptReference/Transform.html

You could adjust the position and rotation of the camera at runtime.

If you would like to learn more head to this link: http://unity3d.com/learn/tutorials/modules

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 raven shield · Sep 02, 2013 at 07:08 AM 0
Share

Do you have any example that starts on blank but when the game run the script will load Game Objects?

avatar image Imawizrd · Sep 02, 2013 at 07:12 AM 0
Share

Your question is unclear. I'm going to assume you want to create a game object at run time. Therefore please read the information on this page. http://docs.unity3d.com/Documentation/ScriptReference/Object.Instantiate.html

Additionally, I suggest taking the time and and completing the tutorials on this page: http://unity3d.com/learn/tutorials/modules

Or finding a tutorial to follow on YouTube which will take you through the basics of Unity.

http://www.youtube.com/watch?v=Q$$anonymous$$Wht$$anonymous$$jUr10

avatar image raven shield · Sep 02, 2013 at 07:45 AM 0
Share

thank you so much

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

18 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

Related Questions

A node in a childnode? 1 Answer

Can't find MonoDevelop. Unity 4.5.2 1 Answer

Can I call a js script method inside a C# dll project? 1 Answer

How to find a script from another Scene? 2 Answers

need enemeyAI with near follow 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