Saturday, 3 October 2020

Activity 3: Object Movement and Rotation

    

                     

               In this blog I will create a moving and rotating object. Just like on my recent blog, first  we must create project and select 2D Template for our Object Movement and Rotation Activity.


     
    
    After Creating the template you will proceed to our application workspace where we can create our game. Then, we must import our objects like Red ball, Brick, platform, and frame which I created using Adobe Illustrator. 

   



Now that we have all we need. On my red ball and Frame, the settings were the same last time. While in my bricks and platform we only use box collider components. I need to make the bricks move on its own and the platform to rotate 360. We use scripting to create their movements.

This is our code for the bricks. The properties we set in order to make it move up-down on the first brick and from upper left to downright.

  


                                                   up down

                        


                                upper left to downright

                        



For our platform rotation movement, I used degreespersec and Time.deltaTime, this procedure will calculate how fast our rotation will be then the transform.localRotation.eulerAngles.Z holds the Z position while the Quaternion.Euler is the method that returns the rotation.
                
       

                                   Platform Object Properties
                     


This is the final result of the Object Movement and Rotation I created.

       




No comments:

Post a Comment

Activity 8: Game Level Feature

              This blog contains information about next level features using Unity 2D.  First, We need Following Image Objects : Player, Met...