Accessing other objects and modifying their components in Unity

3D Game Design with Unity

πŸ•‘ This lesson will take about 9 minutes

This tutorial explains how you can write a script in C# that can access other objects and then modify their components. In this example, we will attach a script to the Main Camera and then use that script to access a Cube object and modify it’s position, rotation and scale.

Is YouTube blocked at school? Watch on Google Drive.

Here is the sample code that is attached to the Main Camera and accessing the Cube object.