Skip to content
Adam Graham edited this page Jul 5, 2023 · 9 revisions

Links

FAQs


Is the source project free to use?

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.


The "grounded" boolean is not getting set to true

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.


The rotation arrow is not changing direction

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.