After my ideas for my game were more fleshed out I wanted to make a solid prototype to experiment with art style for my environment, movement mechanics, as well as perhaps some level design. I worry that the concept of my game may come off as technically challenging to create, so it could also serve as a source of inspiration (not to copy from, as the code will be quite haphazardly made) for a potential team that could make my game.
As such, I decided to adapt the movement code from my Godot prototype into Unity, starting with the scene. I created a sphere for the character with a Rigidbody component, meaning they are a physics object that can have forces exerted on them based on player input. I also created a white room with a tasteful orange floor similar to my Godot level as a testing zone, and gave the player sphere the billiard-ball material to test rotation.

Now came the difficult part: Translating the GDScript code from Godot into C# on Unity.
This was actually much simpler than expected, however, after looking up equivalent functions from one language to the other. However, I also wanted to use Unity’s new Input System to make eventually testing things like controller support much easier, and also just to get some experience with it. I created a new PlayerMovement script and added it to the player, as well as an Actions object, which let me set actions for moving, jumping and looking. Then I just had to enable it in the script and bind the Jump command, as I wanted the player to be able to hold down space for successive jumps.


In my previous Godot experiment, I had the ball roll and be pushed on both the floor and in the air, while limiting the angular velocity and slowing the player down while on the ground:

However, this didn’t feel quite right. In my Unity prototype I experimented with different movement code on both the ground and in the air. I wanted to emulate the snappy controls from Marble Blast, so I tried to increase the ball’s friction and make the angular, or rolling velocity, high. However, this made the ball begin to ride up walls, so for now I am simply pushing it with a force on any input and additionally letting the ball “spin up” while in the air by giving it angular velocity.

I also inserted some code at the beginning to slow down the ball’s angular and linear velocity when no player input is detected.
Now I just had to adjust the roll, push and drag force as necessary as well as the ball’s mass to make the player character feel good.
However, I am still not happy with the movement in its current form and a team making the game would probably use other techniques to deliver the intended gamefeel. Regardless this gave me a lot of insight on improving the movement in the Mechanics section of my GDD.
Environment Settings
I also made some further adjustments to the level’s environment and graphics. For example I made a custom skybox based off the sky colours in Katamari Damacy‘s box art:

I also removed all the real-time and baked global illumination as well as any ambient occlusion to get a flat shaded look, and made the shadows sharp instead of soft. I also use Robin Seibold’s open-source outline shader for outlines around the environment, and this is the result:

This is super reminsicent of my inspirations like N++ and Rez, and pretty close for what I want the base environments to look like, but the real-world objects without outlines would need to be implemented in the finished game, as well as perhaps some clouds and distant collage backdrops for different levels.
Leave a Reply