Enemies: Creating the Astroid behavior | Unity 2D

--

Objective: Create a rotating effect for our Astroid.

After placing the Astroid into our scene, make it prefab and create a new script for it. I’m calling mine simply, ‘Astroid’.

To make it rotate, let’s check out how to do this by reviewing the Unity Documentation.

From the above highlighted, we will use just that. In my Astroid script in the update method I will place the below line of code:

We now have the desired rotating effect:

--

--

Chelsea Cruise
Chelsea Cruise

Written by Chelsea Cruise

Unity Developer, Software Engineer, Game Designer, Graphic Artist

No responses yet