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…

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.

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

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

Read through this to learn how to create a GameObject during runtime:

This one finds a GameObject at run time:

Control camera during runtime (3rd person).

Using the Camera’s Transform component

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

If you would like to learn more head to this link: