Skip to content

billgan1024/fps-unity

Repository files navigation

FPS Game

An FPS game I'm prototyping in Unity.

Features

  • There is an implementation for wallriding and wallrunning which uses a general state system tracking the player's velocity, acceleration, and drag.

  • The platformer component of this project describes a template for a 3D platformer with theoretically perfect collision detection as we avoid using raycasts in favour of OnCollision events.

  • Implementation of projectile weapons automatically aims bullets at the center of the screen despite the bullet origin not being there.

Demo video

3d.game.test.3.mp4

Dev log

June 30, 2022

Fixed a bug where the player would sometimes randomly disengage from walls. This was due to unpredictable behaviour with a rigidbody's velocity when the player hits a wall; sometimes the player could bounce off the wall due to the velocity vector pointing slightly away from the wall. To fix this, I have made the player align their velocity to the current wall the instant TransitionWall() is called.

Player.cs implementation standards

The player has a list of states which have functions that implement the code that runs when you want to transition to that state, regardless of the current state.

Some variables (like ground/wall normals) automatically update every FixedUpdate and thus there is no need to update them as soon as possible in ChangeStateFromCollisions.

About

An FPS project made in Unity.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages