Wednesday, February 8, 2017

Day 7: Making a Minigame - controls

To add physics to the player object, I needed to add a component to the sphere called "RigidBody". This allows the object to interact an collide with other objects.

To make it move, the sphere needed a script. First, I made a folder named "scripts" where I would put the aforementioned script. Then, with the sphere selected, I clicked "add component" in the inspector window, "new script", and named it "PlayerController". I then clicked "create and add" to attach it to the sphere.
         
Now to edit the script. To open the editor, I clicked the gear icon on the script component, and then clicked "edit script". This opened a script editor, in which I pasted the script that allows the ball to move.
                       
Unfortunately, it doesn't seem to be working. Tomorrow I plan to fix that though.

No comments:

Post a Comment