Lab 2: Roll-A-Ball

2020-11-30
2 min read

Get start with Unity…

Some New knowledge in Unity for me:

Customize Script Editor: avatar

Unity Lifecycle: Start ( ) / FixedUpdate( ) / Update( ) avatar

Start to implement a Simple Roll-A-Ball Game following Wenjie’s Slides!

Skipped step: transform Empty GameObject avatar
In my scene, I don’t need to change the transform matrix of the Wall in general.

Import TMP: Unshown steps in the tutorial
avatar It works with only importing the essential package.
Also it’s always tricky to set the position of the text. I figured out this Steps order to help setup a UI text. avatar
avatar

Some Erros & Solutions…

[Problem1] Player Control

Tried to start game, but can’t control the the player. Have no reaction when kicking the keyboard. Find an error when create the Input Actions in the Assest folder. avatar avatar
Tried to create the Input Actions in Inspector. avatar
Installed Input version
avatar

Error1: Input version error avatar

Error2: Try to reimport and updated to the latest version but receive more errors. avatar
Methods:
avatar
Result: No errors but still can’t move
avatar

Final Solutions
Create InputActions in Inspector. https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/QuickStartGuide.html#getting-input-indirectly-through-an-input-action Message sent: avatar
C# scripts: avatar
Solved

[Problem 2] Testing collision

In our program, we detect the collision with the layers. But we couldn’t set the tags for a father Empty Object and apply to all. avatar
Solution: Individually set tags

Final result:

avatar