Back

Thursday 9.6 | Platformer Camera

Platformer Prototype

Today was almost all about implementing an actual platformer camera into the project. Other than that I just added a trail to the sword.

Platformer Camera

I started to notice that I had to fully control the camera which isn't what platformers are about and thought I could fix this before going deeper into combat. I played a couple of old platformers and realized that I was essentially using a 3rd person shooter camera. I knew all along it wasn't the right kind of camera but didn't realise the right one would make such a big difference.

CinemachineFreeLookCamera

Before this I started with fiddling around with the Cinemachine Virtual Camera but didn't seem to find the right one for the job. So I looked into it a bit more and found out that Cinemachine has the right camera but just not within the virtual camera (has like a thousand settings itself), which I quess is made for 3rd and 1st person shooters. The right camera was the "free look" camera with the orbit mode "simple follow with world up", which wants to stay in place(world space) while looking at the player at a specified distance.

Sword Trail

I added a sword trail with the help of a useful tutorial I found on Youtube. For turning it off and on again I use the emission module's RateOverTimeMultiplier, setting it to 0 and back to original when attacking. In need of some polishing effort though.

SwordTrail

Day's Work

  • Implementing the Cinemachine Free Look Camera
    • Input from new input system
    • Cinemachine collider using the smoothed "pull to player" method
    • Smoothing camera height with platform snapping (When grounded or climbing snap player follow transforms target height to players height, Not used in video because in my opinion maybe not needed for this kind of platformer, but time will tell)
  • Sword trail
    • Particle system trail
    • Controlled by weapon manager StartDealingDamage and StopDealingDamage functions
Back