From the course: AR Development Techniques 01: Basic Concepts

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Scripting the Earth rotation behavior in C#

Scripting the Earth rotation behavior in C#

From the course: AR Development Techniques 01: Basic Concepts

Start my 1-month free trial

Scripting the Earth rotation behavior in C#

- In this video, we are going to make the Earth model rotate on its own axis. One way to do that is to add a rotate animation, just like we did in the previous chapter, but we are going to do it differently this time. So, if you want to rotate the Earth along y-axis continuously, then we'll have to increment the y-component of rotation continuously. Let's make this 0 again. So, that's the idea. Let's write a script for that. Inside the Assets folder, I'm going to create a new script, right click, create, C# script, and I'll name this Earth rotate. And we are going to add this script on this Sphere Game Object. So, click on this Sphere Game Object, and drag this script, right here, and this will be added as a component. Alternatively, you can also click on, add competent and type the name of the script and choose it. Double-click on the script to open. And this will open in Visual Studio editor. When we…

Contents