Scale a GameObject up and down in size - 1
Transcript
English (Auto-generated)
hi everyone in this cast, we'll start off with the first tutorial in this in a small series covering animations in unity. So we already have a low poly is seen a setup here. And what we're going to be doing is scaling this game object up and down in size when the game starts like so so here you can see the tree object is animated, it scales up and down in size and we can stop this animation by pressing on any key on the keyboard like so and when we do that it scales up to its maximum size and then stops and we can reactivate this animation once again by pressing on any key on the keyboard like this. Okay, so this game object, this tree game object is nested within the empty scaled game objects here in the hierarchy window to the left And it's called 3003 _ V two and then one and the scaled objects. Um game object itself is under environment, game object. So this is just the general organization of the project. And the script that we're going to be working inside of is going to be called objects killer. Now when you get this project folder you won't have the objects, killer script. But I do since I just needed to demonstrate what we'll be doing. So I'm going to delete the object scalar script and once that's done, I'm also just going to remove the script component from the game object. Okay, now this is where we start. So in the assets folder for number one, which is the first animation which is scaling up and down in size. We want to right click, go up to create and then C sharp script and call this the object scalar script and the optics skills script. Like you can see in the inspector window just has the usual start and update methods inside of the object scalar class, which inherits from mono behavior. So let's attach this script to the tree game object. And the way to do that is to either select the tree game object here in the hierarchy window or in the scene and then drag and drop the object skills script in the inspector window to the right side. There you go. So if I click on play, obviously nothing is going to happen as yet. And in the next cast we'll start working inside of the objects. Killer script by declaring a few public and private variables.