First-Person Shooter: Getting started
In this series of Elympics tutorials, you’ll be creating a simple FPS game for 2 players. It’ll help you understand how our tool works and what you can achieve with it when building a multiplayer shooter. 💪
We will focus on implementing the core FPS components such as:
- player movement 🚶
- managing players’ HP system ❤️🩹
- weapons shooting raycasts and projectiles 🔫
We’ll start with jumping capsules, then go to managing cameras and creating different weapons, and finally handle synchronizing player animations.
All of that fully deterministic and server-authoritative!
Before you start, you’ll need to add Elympics to your project. Just like in the Pong2D, you can do it using the Package Manager.
After adding the Elympics package, you’ll need to create a new game config:
Use the right-click menu to add the Elympics System object to the hierarchy too.
After doing so, you’ll start with a very simple scene setup and the implementation of basic character movement. All you need at this point is a plane.
Player game object
Now, let’s focus on creating the player. You’ll have to create a new, empty GameObject that will be the root for all the components of the player prefab. Make sure that the created object is in position 0,0,0 of the game world and add the following components to it:
- Elympics Behaviour;
- Elympics Rigid Body Synchronizer (added by the button in the Elympics Behavior component).
In the Rigidbody component, you can immediately change Interpolate to “Interpolate” and Collision Detection to “Continuous” and then block all the rotation axes in Constraints.
Now, add 3D Object → Capsule as the child of the player object. Make sure that its position is 0,1,0 in relation to the parent so that the entire “body” of your player is above the ground.
In addition to the Capsule Collider, you can add a properly scaled Cube and move it along the Z axis, which will serve as an indicator of which direction the player’s body is currently facing. This cube doesn’t need any colliders and is only a visual aid for the observer, so if you decide to add it, remove the collider from it.
We’re ready! 🔥
Everything is set and we can start coding! In the next part we’ll focus on player’s movement! 🏃🏼
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.