Devlog #1 - Player Movement


Dev Log #1: Player Movement

This week I implemented a very basic test build to test some basic player movement. Unfortunately I was stretched more than usual for time due to work commitments and an extended Easter break camping trip, so progress was impeded somewhat.

Process:

Initially I explored creating my own player controller, and managed to get a basic functioning left/right movement plus a /somewhat/ functioning jump working. The test scene I have set up with simple boxes/squares, as I haven't yet implemented a grid or tileset to start creating a world with.

Once basic movements were added as above, I quickly realised however that adding some flexibility around jump strength, floatiness(?), and other parameters would be required, and turned to YouTube to do some further research. From there, I stumbled on Tarodev's 2D player movement controller - and was immediately attracted to the fast, smooth, and extremely responsive mechanics. It also introduced the concept of scriptable stats which seemed very useful, and enables fast changes for various parameters. It does however also seem to have the downside of not being as compatible with standard Unity physics, which I need to explore more. 

After taking a look at the Tarodev controller code, I turned to ChatGPT and asked if it would be possible to implement a PlayerMovement script similar to Tarodev, but more compatible with Unity's RigidBody2D physics system. After some back and forth I ended up with a bit of a crossover of my movement script and Tarodev's (more akin to the latter as of now to be honest). The current build implements this (admittedly hacky) controller, and does result in fairly fluid movement - however also has some downsides and bugs that I need to iron out, the primary of which is that the player gets stuck to walls occasionally.

Whilst I haven't yet implemented any "proper" art or animations, I have included a static test sprite, created a very basic script that flips the sprite on the X axis in the SpriteRenderer based on the linearVelocity, and also a Cinemachine camera that follows the player.

Figure 1: Basic player character and movement

Feedback and Improvements:

Primary feedback from the few people I have had test the build is that the movement seems intuitive, but might be a little too responsive in terms of jump amplitude and speed. Testers also encountered the same bug in the first build with the player occasionally getting stuck to walls. 

Further tweaking will be needed, and additional movement mechanics like double-jump and potentially dodging are planned for inclusion as development progresses.

Files

BuildV1.1.zip Play in browser
64 days ago

Leave a comment

Log in with itch.io to leave a comment.