-
-
Notifications
You must be signed in to change notification settings - Fork 13
Home
- Is the source project free to use?
- The "grounded" boolean is not getting set to true
- The rotation arrow is not changing direction
Yes, you are free to use the project for any purpose. However, keep in mind that copyright and/or trademark laws can still apply to the original material since many of the games in my tutorials were not originally authored by me. I open source my own code for the community to learn from, but the project is intended for educational purposes only.
There could be a couple causes to this problem because it is the most complex piece of code in the game. Double check your logic matches this: https://github.com/zigurous/unity-donkey-kong-tutorial/blob/main/Assets/Scripts/Player.cs#L45-L73.
In most cases, the problem is caused by a mismatch in the layer names on the game objects. The code is specifically checking for objects whose layer is set to "Ground" and "Ladder". Verify your platform and ladder prefabs have their layers set to match the respective name in the code.
If you are still having problems, make sure your objects (Mario, platforms, ladders, etc) have a collider component and the size of the collider roughly matches the object's size. Additionally, Mario should have a Rigidbody2D
component otherwise collisions won't occur between him and the other objects.
There is one detail that I forgot to mention in the tutorial video regarding the rotation tool in Unity. There is a button toggle that can be switched between "Local" and "Global", located towards the top-left of the Unity editor. This is a way to visualize the rotation of an object in local coordinate space or in world coordinate space, respectively. We want the toggle to be set to "Local" to help us visualize the rotation of the platforms.