Teaching a new dog new tricks

While programming, I've found it difficult to program with usability and ease of access in mind. However, I recently stumbled across an extremely simple way to simplify my code for both myself and anyone who wants to use it.

    [System.Serializable]
    public class MoveMentSettings
    {
        //Variables that relate to the movement of a character
        public float moveSpeed = 5.0f;
        public float gravity = 9.8f;
        public float jumpVelocity = 10.0f;
        public LayerMask ground;
    }
    public MoveMentSettings moveSettings = new MoveMentSettings();

This simple block of code is great, it creates a dropdown in the Unity inspector and groups all of the variables that I want to pertain to that dropdown to be manipulated. The variables shown above allow for the manipulation of gravity, jump velocity and movement speed values, ultimately changing the way that the character plays.

It's not anything new to many people, but a great thing to know for programmers who are working alongside a team.

Tylah Kapa

@JadeKapa