JELLE VAN DOORNE - GAME & NARRATIVE DESIGN
  • Home
  • Portfolio
    • Angela's Wedding Disaster
    • Angela's High School Reunion
    • Angela's Fashion Fever
    • Viola
    • Press Q To Stop Time
    • SECRET
  • Blog
  • About
  • Contact
  • Presskit

Gravity, Movement, Jumps and Cameras

17/3/2018

0 Comments

 
This week I spent most of my time doing the following:
  • Writing different physics for 2D objects
  • Implementing 2D character control
  • Wrote collision and jumps
  • Implemented a camera designed for 2D platformers
More information below the break!
Picture

Tutorial Makes Perfect

I've always been a little unsatisfied with the gravity and physics in Unity. Unity used to be specialized in semi-realistic 3D games, so the physics match what you would expect from reality. However, it always caused platformer games to feel floaty and slow. I wanted to write my own 2D character controller, so I could tweak as many aspects of it as possible and make the game's jumping feel fast and fun.

Luckily for me, Unity itself provides a set of tutorials about how to create your own 2D physics and character control. With those, I was able to create my own, with tweakable settings.
Picture
Rigidbody and Capsule Collider are (obviously) default Unity components. Player Control lets the player control their character. The script inherits from a C# class I had to write that handles gravity and collision, since we're not using the default gravity created by a Rigidbody. I put in a few settings to modify to make it easy to find a satisfying walk speed and jump speed.

While I was at it, I took a sound effect sample to play when the player jumped. I wanted to manage the audioclips in a different script, but making it a separate setting in the same script was a lot simpler.
Picture
Using Cinemachine to create a competent camera system.
The default Unity camera also leaves a lot to be desired. It can effectively follow a character, but it doesn't work the way you would want to. I initially wanted to write my own camera system, but I found out about Cinemachine, a free plugin that creates highly tweakable cameras.

With Cinemachine, I was able to create a "deadzone": an area where the player can move their character freely, without the camera moving along with them. This is common for 2D platformers. On top of that, I was able to add a "confiner". The Cinemachine confiner requires a polygon collider, and the camera will not be able to move beyond that area, so the player can't see outside of the level.
Picture
I used Trello to keep track of my progress.
I ended up finishing a bit early in the week, so I filled up the time working on:
  • Getting build settings running
  • Working on a main menu
  • Working on a loading screen
  • Creating movement for an overworld
  • Designing 2 new characters
  • Creating mock-ups of the RPG battles
  • Creating mock-ups for the start menu
  • Writing out a design document containing all the design choices (25 pages long right now)
Stuff I'm sure will be in a different blogpost!

Next week: More platforming mechanics beyond the basic jump.
0 Comments



Leave a Reply.

    Tweets by GameViola

    About

    This is a development blog for my own game project, "Viola".

    Picture

    Archives

    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018

    Categories

    All
    Art
    Design
    Music
    Programming
    Story
    Viola

    View my profile on LinkedIn

    RSS Feed

Site

Portfolio
About
​Contact
  • Home
  • Portfolio
    • Angela's Wedding Disaster
    • Angela's High School Reunion
    • Angela's Fashion Fever
    • Viola
    • Press Q To Stop Time
    • SECRET
  • Blog
  • About
  • Contact
  • Presskit