November 2019
Intermediate to advanced
404 pages
12h 9m
English
Imagine you want to have thousands of similar items in your scene. This is not a strange request; there may be many valid reasons for that: you may wish to render thousands of ships in a gigantic galactic battle, or you may want to animate thousands of units for a Real-Time Strategy (RTS) game, or you may want to handle a massive number of particles.
For simplicity, in our demo, we want a scene with 10,000 spinning cubes. So let's begin:
using UnityEngine;namespace Classic{ public class Rotator : MonoBehaviour { public float rotationSpeed; void Update() { transform.Rotate(0f, rotationSpeed * Time.deltaTime, 0f); } }}
The script ...
Read now
Unlock full access