Overview

3D Platform Runner is a platform runner built with Unity and C# scripting by MSKDevHub. The project focuses on fast-paced 3D platforming and running mechanics, responsive player movement and jumping, dynamic levels and obstacles, and interactive UI, targeting both Windows and WebGL.

"A 3D platform runner is a great way to explore spatial game design, character control, and level pacing in Unity."

Key Features

Player Movement & Jumping

Responsive 3D character movement, jumping, and control systems built in C#.

Dynamic Levels & Obstacles

Designed levels with obstacles and platforming challenges to keep the runner engaging.

Health & Score Systems

Health and score systems that track player progress through the level.

Interactive UI

Interactive UI elements for menus, HUD, and in-game feedback.

Technical Implementation

The project uses Unity with the Universal Render Pipeline (URP) and modular C# scripts split across player, environment, health, and UI responsibilities. It is configured for cross-platform builds on Windows and WebGL with optimized 3D assets and animations.

Player Controller (C#)

A simplified example of a 3D character controller for movement and jumping:

using UnityEngine;

public class PlayerController : MonoBehaviour
{
    public float moveSpeed = 6f;
    public float jumpHeight = 2f;
    public float gravity = -20f;

    private CharacterController controller;
    private Vector3 velocity;
    private bool isGrounded;

    void Start()
    {
        controller = GetComponent<CharacterController>();
    }

    void Update()
    {
        isGrounded = controller.isGrounded;
        if (isGrounded && velocity.y < 0) velocity.y = -2f;

        float moveX = Input.GetAxis("Horizontal");
        float moveZ = Input.GetAxis("Vertical");
        Vector3 move = transform.right * moveX + transform.forward * moveZ;
        controller.Move(move * moveSpeed * Time.deltaTime);

        if (Input.GetButtonDown("Jump") && isGrounded)
            velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity);

        velocity.y += gravity * Time.deltaTime;
        controller.Move(velocity * Time.deltaTime);
    }
}

Installation & Usage

Running the game locally requires Unity Hub and Unity Editor.

  • Clone the repository from GitHub: git clone https://github.com/mskreallabs/Unity-3D-Platform-Runner-Game.git.
  • Open Unity Hub, click Add, and select the cloned project directory.
  • Ensure the correct Unity version is selected and launch the project.
  • In the project browser, open the main scene and press the Play button to run and test the game.