top of page

VR System - Create and Access Objects via Scripts in Unity

  • Writer: Son Luu
    Son Luu
  • Dec 1, 2020
  • 1 min read

Today I learned and practiced some VR coding in Unity by experimenting creating and accessing game objects via script. Here are some of the results


Experiment 1: create 10 random spheres


ree


Experiment 2: create random sphere with the visible option to control the number of spheres created by adding a field N to input desired number of spheres to be created.


ree

Below is result if the input is 1000 spheres to be created.

ree




Experiment 3: Adding random colors to the created spheres


ree

ree



Experiment 4: Adding a light source inside every sphere created.


ree


Opened in Unity in Play mode, and click on a random sphere, the inspector will show the color and other components. specific to that object.


ree

Comments


bottom of page