Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Welcome to the documentation for FPS Engine, the Best Development Product Award Winner in the 15th Unity Awards.
Thank you for purchasing FPS Engine! We hope you enjoy it as much as we love creating it. We're passionate about this project and can't wait to see what you create with the best FPS asset on the Unity Asset Store!
We'd greatly appreciate your support through a review. Join others in sharing what you love about FPS Engine!
Explore the different available tutorials for FPS Engine. At Cowsins, we are constantly improving FPS Engine and the content around the package, so more tutorials will be uploaded!
IMPORTANT INFORMATION REGARDING TUTORIALS Hey everyone,
Cowsins is currently experiencing some issues regarding the YouTube channel. For that reason, the tutorials are not available on YouTube right now. However, they have been backed up at the following link for now:
https://www.cowsins.com/ If you need help, feel free to reach out for support, we´ll be happy to assist you!
We are sorry for this inconvenience and we hope to solve this issue as soon as possible. Let´s keep creating!
How to add New Weapons in FPS Engine 1.3 using the WEAPON CREATION ASSISTANT
How to Import FPS Engine in Unity 6 ( HDRP )
How to Import FPS Engine in Unity 6 ( URP )
How to Import FPS Engine in Unity 6 ( BiRP )
[ DEPRECATED FOR FPS ENGINE >0.9.6] HOW TO ADD NEW WEAPONS
HOW TO ADD NEW WEAPONS ( UPDATED FOR >0.9.6 )
WORKING WITH ATTACHMENTS IN FPS ENGINE 0.9.7
ADDING VARIABLES TO CUSTOM INSPECTORS IN FPS ENGINE
How to use weapons In FPS Engine: Adding Weapon Pickeables & Initial Weapons
Exporting Weapons from Blender to Unity ( FPS Engine )
Importing FPS Engine into URP / HDRP
FIRST STEPS WITH FPS ENGINE - Standalone Installation + Getting Started
How to Set Up Grounds & Walkable Surfaces in FPS Engine
How to add Touch Input Controls in FPS Engine ( Make Mobile Phone Games with FPS Engine )
How to add Custom Interactables in FPS Engine
This script handles FOV for different movement states such as running, walking or wallrunning.
Player: Reference to our player ( Rigidbody ).
SetFOV ( float fov )
If allowed ( Not aiming ), sets the fov to the defined value. Uses the default lerpSpeed.
fov: Target field of view.
SetFOV ( float fov, float speed )
If allowed ( Not aiming ), sets the fov to the defined value.
fov: Target field of view.
speed: Override the lerp speed of the camera. ( Speed to go from the current FOV to the default FOV ).
ForceAddFOV ( float fov)
Whether allowed or not, adds a desired value to the current field of view.
fov: field of view value to add to the current fov.
Cowsins as a publisher on the Unity Asset Store, including Cowsin´s assets such as this specific one, COWSINS: FPS ENGINE, is protected under Unity Asset Store terms of service and EULA.
The Unity Asset Store terms of service and EULA protect Cowsins™ as a publisher on the marketplace, including Cowsin's™ assets such as COWSINS: FPS ENGINE.
The Assets are protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties.
END USER may modify Assets. END USER shall not reverse engineer, decompile, or disassemble Services SDKs, except and only to the extent that such activity is expressly permitted under mandatory statutory applicable law.
This document may be updated following new releases. The asset itself might undergo various changes, including updates, new content, reworks, improvements, and optimizations.
Yes. You can make a game with FPS Engine and sell or distribute the game.
You don´t need to. Credit is voluntary, but much appreciated
playerCam: The parent GameObject to which the main camera should be attached.
orientation: An object with the same height as the camera, used to rotate the player around the Y-axis for visual orientation.
useSpeedLines: Enables or disables speed line effects that appear when the player reaches a certain speed threshold.
speedLines: A reference to the particle system component that generates the speed line effects.
minSpeedToUseSpeedLines: The minimum speed required for speed lines to be displayed.
speedLinesAmount: Being 1 = default, amount of speed lines displayed.
autoRun:Enables automatic running without requiring the player to hold a sprint button.
alternateSprint: Defines the sprint behavior:
True
: Hold to sprint, release to stop sprinting.
False
: Press and hold to sprint continuously.
alternateCrouch: Defines the crouch behavior:
True
: Hold to crouch, release to uncrouch.
False
: Press and hold to crouch continuously.
canRunBackwards: Determines if the player maintains running speed while moving backward:
True
: Running speed applies when moving backward.
False
: Walking speed applies when moving backward.
canRunSideways: Determines if the player maintains running speed while moving sideways (strafing):
True
: Running speed applies when strafing.
False
: Walking speed applies when strafing.
canRunWhileShooting:Determines if the player maintains running speed while shooting:
True
: Running speed applies while shooting.
False
: Walking speed applies while shooting.
loseSpeedDeceleration: The rate at which the player's speed decreases from running to walking
acceleration: The player's ability to gain speed quickly.
runSpeed: The player's running speed
walkSpeed: The player's walking speed
allowCrouch: Enables or disables the player's ability to crouch.
crouchCancelMethod: Defines how the player can exit the crouch state. ( Smooth, FullStop )
crouchSpeed: The player's movement speed while crouching
crouchTransitionSpeed: The speed at which the player transitions into and out of the crouch state
roofCheckDistance: Distance to detect a roof above the head.
maxSpeedAllowed:The maximum speed the player can reach, used to clamp the player's velocity.
whatIsGround: A bitmask representing the layers considered ground. The player can walk on objects within these layers. Check Adding New Surfaces ( Grounds )
groundCheckDistance: The distance from the bottom of the player to check for ground collision.
frictionForceAmount: The amount of force applied to the player's movement to simulate friction.
maxSlopeAngle:The maximum angle (in degrees) of a slope the player can walk on.
WARNING: The maximum camera angle is highly recommended to be set to the maximum value, 89.7
maxCameraAngle: The maximum vertical angle (in degrees) allowed for the camera rotation. This limits how far the player can look up or down
WARNING: The Player Sensitivity (Mouse & Controller) values will be overridden if you open the scene from the Main Menu. Check GameSettingsManager.cs for more information.
sensitivityX: Horizontal sensitivity (X Axis)
sensitivityY: Vertical sensitivity (Y Axis)
controllerSensitivityX: Horizontal sensitivity (X Axis) using controllers
controllerSensitivityY: Vertical sensitivity (Y Axis) using controllers
aimingSensitivityMultiplier: Sensitivity will be multiplied by this value when aiming
normalFOV: Default field of view of your camera
runningFOV: Running field of view of your camera
wallrunningFOV: Wallrunning field of view of your camera
fovToAddOnDash: Amount of field of view that will be added to your camera when dashing.
fadeInFOVAmount: Fade Speed - Start Transition for the field of view
fadeOutFOVAmount: Fade Speed - Finish Transition for the field of view
slidingCameraTiltAmount: Rotation of the camera when sliding. The rotation direction is defined by the sign of the value.
cameraTiltTransationSpeed: Speed of the tilt camera movement. This is essentially used for wall running
Enabling this unlocks new customization variables under "CAMERA"
allowSliding: Enables or disables sliding for the player.
slideForce: Forward Force added to the Player on sliding.
slideCounterMovement: The amount of force applied in the opposite direction of the player's movement during a slide
allowJump: Enables or disables the player's ability to jump.
maxJumps: Amount of jumps you can do without touching the ground
resetJumpsOnWallrun: Gains jump amounts when wallrunning.
resetJumpsOnWallBounce: Gains jump amounts when wallrunning.
directionalJumpMethod: Method to apply on jumping when the player is not grounded, related to the directional jump
directionalJumpForce: Force applied on an object in the direction of the directional jump
jumpForce: The higher this value is, the higher you will get to jump.
controlAirborne: How much control you own while you are not grounded. Being 0 = no control of it, 1 = Full control.
allowCrouchWhileJumping: Turn this on to allow the player to crouch while jumping
canJumpWhileCrouching: Allow the player to jump mid-air.
jumpCooldown: Interval between jumping
coyoteJumpTime: Coyote jump allows users to perform more satisfactory and responsive jumps, especially when jumping off surfaces
applyAimAssist: Determine wether to apply aim assist or not.
maximumDistanceToAssistAim: Maximum distance to keep the Aim Assist
aimAssistSpeed: CamerDefine wallrunnable wall layers. By default, this is set to the same as whatIsGround.aOur Slider UI Object. Stamina will be shown here Snapping speed.
aimAssistSensitivity: size of the aim assist range.
usesStamina: You will lose stamina on performing actions when true.
minStaminaRequiredToRun: Minimum stamina required to being able to run again.
maxStamina: Max amount of stamina.
staminaRegenMultiplier: Stamina Regeneration Speed
LoseStaminaWalking: Loses Stamina Walking if true.
staminaLossOnJump: Amount of stamina lost on jumping
staminaLossOnSlide: Amount of stamina lost on sliding.
staminaLossOnDash: Amount of stamina lost on dashing (Introduced in 1.3).
staminaSlider: Our Slider UI Object. Stamina will be shown here
WALL RUN
canWallRun: When enabled, it will allow the player to wallrun on walls
whatIsWallRunWall: Define wallrunnable wall layers. By default, this is set to the same as whatIsGround.
useGravity: When enabled, gravity will be applied on the player while wallrunning. If disabled, the player won´t lose height while wallrunning.
wallrunGravityCounterForce: Since we do not want to apply all the gravity force directly to the player, we shall define the force that will counter gravity. This force goes in the opposite direction from gravity.
maxWallRunSpeed: Maximum speed reachable while wall running.
normalWallJumpForce: When wall jumping, force applied on the X axis, relative to the normal of the wall
upwardsWallJumpForce: When wall jumping, force applied on the Y axis.
stopWallRunningImpulse: Impulse applied on the player when wall run is cancelled. This results in a more satisfactory movement. Note that this force goes in the direction of the normal of the wall the player is wall running.
wallMinimumHeight: Minimum height above ground (in units) required to being able to start wall run. Wall run motion will be cancelled for heightsMethod to determine length of wallRun. below this
cancelWallRunMethod: Method to determine length of wallRun.
WALL BOUNCE
canWallBounce: When enabled, it will allow the player to wall bounce on walls.
wallBounceForce: Force applied to the player on wall bouncing. Note that this force is applied on the direction of the reflection of both the player movement and the wall normal.
wallBounceUpwardsForce: Force applied on the player on wall bouncing ( Y axis – Vertical Force ).
oppositeWallDetectionDistance: maximum Distance to detect a wall you can bounce on. This will use the same layer as wall run walls.
DASHING
canDash: When enabled, it will allow the player to perform dashes.
dashMethod: Method to determine how the dash will work
infiniteDashes: When enabled, it will allow the player to perform dashes.
amountOfDashes: maximum ( initial ) amount of dashes. Dashes will be regenerated up to “amountOfDashes”, you won´t be able to gain more dashes than this value, check dash Cooldown.
dashCooldown: Time to regenerate a dash on performing a dash motion
damageProtectionWhileDashing: When enabled, player will not receive damage
dashForce: force applied when dashing. Note that this is a constant force, not an impulse, so it is being applied while the dash lasts
dashDuration: Duration of the ability ( dash ).
canShootWhileDashing: When enabled, it will allow the player to shoot while dashing.
GRAPPLING HOOK
allowGrapple: If true, allows the player to use a customizable grappling hook.
maxGrappleDistance: Maximum distance allowed for the player to begin a grapple action
grappleCooldown: Once the grapple has finished, time to enable it again.
distanceToBreakGrapple: If the distance between the grapple end point is equal or less than this value ( in Unity units ), the grapple will break.
grappleForce: Force applied to the player on grappling.
grappleSpringForce: Spring Force applied to the rope on grappling.
grappleDamper: Damper applied to reduce ropes´ oscillation.
drawDuration: Time that takes the rope to draw from start to end.
ropeResolution: Amount of vertices the rope has. The bigger this value, the better it will look, but the less performant the effect will be.
waveAmplitude: Size of the wave effect on grappling. This effect is based on sine.
waveAmplitudeMitigation: Speed to decrease the wave amplitude over time
CLIMBING LADDERS
canClimb: If true, allows the player to climb Ladders.
maxLadderDetectionDistance: Maximum Distance to detect a Ladder
climbSpeed: Speed to Climb up the Ladder
topReachedUpperForce: On reaching the top, this is the upwards force applied to the Player
topReachedForwardForce: On reaching the top, this is the forward force applied to the Player
allowVerticalLookWhileClimbing: Enable this to allow the Player to move the Camera vertically
hideWeaponWhileClimbing: Hides the Weapon when Climbing
sounds: Player Movement Sounds
grappleSounds: Player Grapple Sounds
footstepVolume: Volume of the AudioSource.
footstepSpeed: Play speed of the footsteps.
footsteps: Footstep clips for all the ground layers
events
RegainDash()
Adds a dash to the dash count of the player.
ResetDashes()
Reset all the dashes to the maximum amount of the dash count of the player.
TeleportPlayer(Vector3 position, Quaternion rotation)
Teleport the player to the specified position and rotation.
position: Vector3 to teleport the player to.
rotation: Rotation for the camera to aim at on teleport.
PlayerMovementEditor.cs can be found as an external script.
Welcome to FPS ENGINE by Cowsins.
At Cowsins™ we have always been passionate about videogames, and specially about game development, and that´s why we built this asset with all our love, dedication, attention to detail and knowledge we could deliver.
We are so excited to see how the project evolves in a new thrilling journey for us.
So, what´s coming next? Upcoming updates will feature major improvements and adjustments, as well as feature introductions!
You can suggest new features in our discord server!
Check the official Trello board!
This script places the camera at its correct position and makes sure it is properly situated.
Head: Reference to our head = height of the camera. This is a transform inside the Player Prefab.
You will find all the information you want in this area, together with an explanation of each variable, to comprehend how the scripts included in the package operate.
Please notice that the information for each variable can be found within the Unity Editor as well ( hover any FPS Engine variable and wait until you can see a message pop up ). In this section, you won´t only find these, but also methods that you can use from each script to expand FPS Engine.
Remember also that all the code is well documented with comments.
All these scripts belong to the namespace cowsins, so if you are trying to access them externally, please make sure you are using the cowsins library.
Inspector Variable: A variable that can be edited through the Unity inspector.
Public Function: A function that can be accessed through code.
Accessors ( Variable Type )
The scripts will be arranged similarly to how they are here, within the appropriate directories.
Explore the content organization:
If you already have a version of Unity that supports FPS ENGINE (2021.1.16 or above), you can skip to the next step. Otherwise, please visit the Unity Download Archive to select and install a compatible version.
Afterwards, download and install Unity Hub, which helps you manage all your projects and versions in one place. If you already have Unity Hub, you'll be directed to its download page.
Keep in mind that the asset was using Unity 2021.1.16.
After installing your desired version of unity, open the Unity Hub.
Select "New Project" under "Projects" in the menu. A new window will then open as a result.
The render pipelines that Unity provides will be available for you to choose from here. The default standalone render pipeline was used to create the package. Choose 3D out of all the possibilities if you want to maintain all the materials and graphic settings for the project that the asset includes.
You can select a different render pipeline, but keep in mind that you will need to translate each material into the materials used by that render pipeline.
You can use FPS Engine with URP or HDRP, here´s a tutorial you can watch to import FPS Engine in either URP or HDRP:
Step 05 also covers URP & HDRP Import instructions.
Once Unity is fully loaded, we´ll import the asset. To do that, go to the Unity Package Manager (Window/Package Manager).
On the new window, select “My Assets” which stands for the assets you own.
Search “FPS Engine” and click download.
Once it is downloaded, click import.
IMPORTANT: During the installation process, import the dependencies, and enable the new Input System.
Have in mind that the asset includes dependencies, such as TextMeshPro, InputManager or PostProcessing.
Note that even though FPS Engine is fully compatible with URP and HDRP, you may lose the world space shader as well as you will need to replace all the materials from the Built-in pipeline to the one you chose: Apart from that, FPS Engine should work as usual!
To upgrade built-in Shaders:
Open your Project in Unity, and go to Edit > Render Pipeline > Universal Render Pipeline. This menu option has changed in 2022.3 LTS: it's now Window > Rendering > Render Pipeline Converter.
According to your needs, select either Upgrade Project Materials to URP Materials or Upgrade Selected Materials to URP Materials.
Additionally, you will require to update the Grid material manually, as it requires a custom shader that cannot be used in URP or HDRP. This Grid material can be found under the path: Cowsins\Materials\Environment\Grid\GridMaterial.
If you encounter issues with the Camera (you can´t see anything, or your screen is blue). Navigate to WeaponCamera under your Player and set the RenderType of the Camera Component to “Overlay”. Then, set it as “Stacked Camera” in the Main Camera inspector.
Check Unity´s official documentation regarding this for more information.
What to do next? Check Getting Started:First Steps.
Following these steps, your project ought to be operational. If you have any problems or inquiries, you can get in touch with Cowsins™.
E-mail : cowsinsgames@gmail.com
Discord: https://discord.gg/mqdnyYZ894
Twitter: https://twitter.com/cOWsins
Establishes the fundamental structure of the states. This layout applies to all Player States.
Allows the player to utilize and access the Player States.
CurrentState ( PlayerBaseState ) / Public get / Private set
Returns the current state of the state machine ( which inherits from PlayerBaseState )
_States ( PlayerStateFactory ) / Public get / Private set
ForceChangeState(PlayerBaseState newState)
Forces the state machine to switch states.
The FPS Engine utilizes two distinct state machines: one dedicated to player movement and the other managing the weapon system. Within this folder, you will find all the various weapon states implemented in the FPS Engine, alongside the corresponding state machine logic.
PlayerStats inherits from IDamageable.cs, which is an interface. Notice that all Damageable objects in FPS Engine inherit from IDamageable.cs
PLAYER STATES
maxHealth: The initial amount of health points the player has.
maxShield: The initial amount of shield points the player has.
FALL DAMAGE
takesFallDamage:Enables or disables fall damage. When true, the player takes damage when falling from a great height.
minimumHeightDifferenceToApplyDamage: The minimum distance (in units) the player must fall to take fall damage.
FallDamageMultiplier A multiplier applied to the base fall damage to determine the final damage dealt. Higher values mean greater damage per unit fallen.
AUTO HEAL
enableAutoHeal: Enables or disables automatic player healing over time.
healRate: The rate at which the player's health regenerates.
healAmount: The amount of health regained with each heal tick (alternative to healRate for discrete healing).
restartAutoHealAfterBeingDamaged:When true, being damaged resets the auto-heal timer, delaying healing until the timer expires again.
restartAutoHealTime: The time (in seconds) it takes for auto-heal to resume after being disabled by damage (if restartAutoHealAfterBeingDamaged
is true).
Controllable ( bool ) / Public get / Private set
Returns true if the player can be controlled.
Returns the value of "controllable"
Grant Control()
Force Controllable to be true.
Lose Control()
Force Controllable to be false.
CheckIfCanGrantControl()
Checks if the game is paused before providing control to the player.
Recommended usage over GrantControl to avoid issues.
Respawn( Vector3 position )
Respawns the player at a given position.
position: Position to teleport the player to.
PlayerStatsEditor.cs can be found as an external script.
Allows the player to utilize and access the Player States.
CurrentState ( WeaponBaseState ) / Public get / Private set
Returns the current state of the state machine ( which inherits from WeaponBaseState )
_States ( WeaponStateFactory ) / Public get / Private set
ForceChangeState(WeaponBaseState newState)
Forces the state machine to switch states.
Establishes the fundamental structure of the states. This layout applies to all Weapon States.
Introduced in 1.3
This component enables you to display handy debugging information about the Player. By default, none of the Player Controllers include this component. If you need to access these debug values, follow these instructions:
Locate the Player object within your PlayerController prefab. Ensure this Player object includes components such as PlayerMovement, WeaponController, etc...
Assign the PlayerDebugger component
This way, you can now visualize important information related to your Player Controller. In case you do not need this debug information anymore, simply remove PlayerDebugger from your player or disable it.
Used for Bullets instantiated by the Player only
This script must be attached to the projectile of a Projectile Shoot Style Weapon. Let´s take a look at the provided Rocket Launcher. As you can see, it only accepts Prefabs with the Bullet component attached as a reference for the projectile.
This projectile must have a Trigger Collider assigned as well, otherwise no collision will be detected.
This component identifies a weapon prefab. It enables the WeaponController to determine which weapon is currently unholstered and its corresponding Weapon_SO. This functionality is also highly beneficial for managing weapon attachments.
Weapon: This Weapon_SO must match the Weapon_SO that contains this WeaponIdentification.
FirePoint: Every weapon, excluding melee, must have a firePoint, which is the point where the bullet comes from. Make an empty object, call it firePoint for organization purposes and attach it here. Refer to Adding New Weapons for more information.
AimPoint: Transform that defines the aiming point. Generally placed on the Iron Sights / Scope.
defaultAttachments: Defines the default attachments for your weapon. The first time you pick it up, these attachments will be equipped.
compatibleAttachments: Defines all the attachments that can be equipped on your weapon.
Refer to Working With Attachments
inventorySize: Maximum amount of weapons you can have
initialWeapons: An array that includes all your initial weapons.
mainCamera: Attach your main camera
cameraPivot: Attach your camera pivot object
weaponHolder: Attach your weapon holder
resizeCrosshair: Do you want to resize your crosshair on shooting ?
autoReload: If true you won´t have to press the reload button when you run out of bullets
alternateAiming: If false, hold to aim, and release to stop aiming.
hitLayer: What objects should be hit
removeCrosshairOnAiming: Do not draw the crosshair when aiming a weapon
canMelee: Enables and Disables the Melee Attack ( Press F to Attack )
holsterMotionObject: Animator the plays an animation to hide the Weapon
meleeDuration: How much time the melee lasts
meleeDelay: Delay time to hit the target
meleeAttackDamage: Damage to deal.
meleeRange: How far you are able to land a hit
meleeCamShakeAmount: Camera Shake on Melee
reEnableMeleeAfterAction: Enable Time to elapse after executing a Melee Attack
effects
events
WeaponControllerEditor.cs can be found as an external script.
The available attachments are the following:
All of these attachments and their respective scripts inherit from Attachment.cs, so they also share the following variables:
attachmentIdentifier: Identifier of the attachment. You can have the same attachment within different weapons as long as they share this attachment identifier scriptable object.
weightAdded: Weight to add to the weapon. If it weighs less, set a negative value.
reloadSpeedIncrease: Percentage added to the base reload speed
aimSpeedIncrease: Percentage added to the base aim speed
fireRateIncrease: Percentage added to the base fire rate
damageIncrease: Percentage added to the base damage
cameraShakeMultiplier
penetrationIncrease: Percentage added to the base penetration
Weapon_SOs are at the heart of the FPS Engine's weapon systems. They define all the characteristics and stats for the different weapons in your project. A Weapon_SO is a scriptable object, which means you can create a unique one for each weapon by right-clicking in your Project folder, going to Create → COWSINS → New Weapon.
FPS Engine comes with various showcase weapons that have Weapon_SOs fully configured. You can find them under Cowsins/ScriptableObjects/Weapons.
Understanding the importance of Weapon_SOs is crucial for adding new weapons. If you're unsure how to add weapons in the FPS Engine, be sure to check out the following tutorial:
Name: You weapon´s name. Ex: Glock
WeaponObject: Attach your weapon prefab here. This weapon prefab will be instantiated on your screen when you equip this weapon.
Pick Up Graphics: Visuals that will appear on a dropped weapon.
Icon: Custom image of your weapon
ShootStyle: Type of shooting.
Hitscan = This weapon fires and instantly hits its target at any range.
Projectile =Fires a physical bullet that travels through the world and can be affected by gravity
Melee: Close range weapons such as swords or knives.
ShootMethod: Defines how Input is processed to shoot.
Press
PressAndHold
HoldAndRelease
HoldUntilReady
FireRate: Time between each shot
BulletRange: How far the bullet is able to travel
BulletsPerFire: Bullets instantiated per each shot. Grants the possibility of making shotguns, burstguns etc.
TimeBetweenShots: Elapsed time until the next bullet spawns.
AmmoCostPerFire: How much ammo you lose per each fire ( & per each fire point )
ApplyBulletSpread:Apply spread per shot
SpreadAmount:How much spread is applied.
AimSpreadAmount:How much spread is applied while aiming.
ApplyRecoil:Apply recoil on shooting
RecoilX: Horizontal Recoil Animation Curve
RecoilY: Vertical Recoil Animation Curve
These two movements are mixed to create the pattern.
xRecoilAmount: Horizontal Recoil Distance
yRecoilAmount: Vertical Recoil Distance
RecoilRelaxSpeed: : When the user is not shooting, speed to go from the current recoil point to the origin point of the recoil.
ApplyDifferentRecoilOnAiming: Enable this to set different recoil amounts while aiming.
xRecoilAmountOnAiming: Distance of the recoil on the X axis while aiming.
yRecoilAmountOnAiming: Distance of the recoil on the Y axis while aiming.
PenetrationAmount: Amount of bullet penetration ( Wallbang )
PenetrationDamageReduction: Damage reduction multiplier. From 0 to 1 ( 0% to 100% )
Projectile: Attach your projectile here. It must have a Bullet.cs script attached to it.
ProjectileUsesGravity: When enabled, your projectiles will use gravity and describe a parabola. It is important to set a rigidbody to the projectile attached above. You can easily adjust the parabola with the rigidbody and projectile speed settings
Speed: Speed of the instantiated projectile
ShootDelay: Time to wait for the bullet to be shot.
BulletDuration: Bullet Lifetime.
HurtsPlayer: When enabled, projectiles will also hurt the player. Generally used for explosive weapons.
ExplosionOnHit: When enabled, the projectile will cause an explosion on hit. Check new features unlocked under the “Visuals” tab.
ExplosionRadius: Area to deal damage and apply explosion forces to.
ExplosionForce: Force applied on nearby rigid bodies ( with the explosion radius ).
AttackRange: How far you are able to land a hit
AttackRate: Attacking pace. TheTime to delay the melee hit lower, the faster.
HitDelay: Time to delay the melee hit
Infinite Bullets: If true, you will never run out of bullets. Bullets and Magazine UI won´t be displayed for infinite bullets weapons.
MagazineSize: Magazine capacity. Amount of bullets per magazine.
: If true, your weapon will have a certain amount of bullets, so you can run out of ammo.
TotalMagazines: Amount of initial magazines. Amount of initial bullets = magazineSize * TotalMagazines.
DamagePerBullet: Amount of damage dealt per each body shot.
CriticalDamageMultiplier: If a headshot is landed, base damage (DamageperBullet) will be multiplied by this.
ApplyDamageReductionBasedOnDistance: if true, damage will decrease or increase depending on how far you are from the target
MinimumDistanceToApplyDamageReduction: Damage reduction will be applied for distances larger than this
DamageReductionMultiplier: Adjust the damage reduction amount
ReloadStyle: The way the weapon reloads
DefaultReload
Overheat
ReloadTime: Time required to fully reload your weapon.
AllowAim: Enable this if you want the players to be able to aim the weapon. Check new options unders spread options.
AimDistance: Distance of the camera from the aim point
AimingRotation: : Rotation of the weapon while aiming.
AimingSpeed: Interpolation speed between states.
AimingFOV: Camera field of view while aiming.
AllowAimingIfReloading: Allows the player to aim even when reloading. False by default.
SetMovementSpeedWhileReloading: If true, you will be able to determine a velocity for your player while you are aiming.
MovementSpeedWhileAiming: Speed of the player while aiming.
ApplyWeight: If true, the weight of the weapon will affect the speed of the player.
WeightMultiplier: Being 1 the lightest, and 2 the heaviest.
useProceduralShot: Set this to true if you want to use a procedural shot instead of an animation.
proceduralShotPattern: Attach your procedural shot pattern here.
GrapplesFromTip: : if your player can use the grappling hook, enable this to draw the rope ( or grapple hook ) from the tip of your gun. This position will be the position of your first firePoint.
CamShakeAmount: Amount of camera shake per shot. Recommended = .15f
CamShakeCrouchMultiplier: Multiplier applied to the cam shake amount when crouching
CamShakeAimMultiplier: Multiplier applied to the cam shake amount when aiming.
ApplyFOVEffectOnShooting: If true it will apply a different FOV value when shooting to add an extra layer of detail. FOV will automatically lerp until it reaches its default value.
FOVValueToSubstract: : FOV Value to substract to the current fov value.
AimingFOVValueToSubstract: FOV Value to substract to the current fov value when aiming.
ShowBulletShells: If enabled, bullet shells will be instantiated on shooting.
BulletGraphics: Bullet shells 3D gameObject. This will be instantiated on shooting
BulletHoleImpact: Array of visual effects on bullets hitting objects. Attach each layer its own impact effect.
BulletTrail: Assign a Trail Renderer prefab that follows the bullet.
audioSFX: Array of AudioClips for each specified event, such as firing or reloading. Add your clips individually for each situation
pitchVariationFiringSFX: Per each shot, pitch will be modified by a number between - pitchVariationFiringSFX and +pitchVariationFiringSFX
crosshairResize: Crosshair size when shooting.
crosshairPreset: Crosshair preset for the specific weapon
Weapon_SOEditor can be found within Weapon_SO.cs
Inside the Cowsins/Scripts/Weapons folder, there's a subfolder called Attachments. This is where you'll find all the necessary scripts for the Attachment System to function.
For more information regarding using Attachments with Weapons in FPS Engine, please check the following tutorial found in the List of Tutorials:
lightSource: Light for the flashlight
turnOnSFX: SFX for turning the flashlight on.
turnOffSFX: SFX for turning the flashlight off.
CheckIfCanTurnOn(bool cond)
If the provided condition is met, the flashlight will turn on.
cond: condition to be met for the flashlight to be turned on.
EnableFlashlight(bool cond)
Forces the flashlight to turn on if the condition is met.
Light source will be enabled or disabled too.
cond: condition to be met for the flashlight to be turned on.
Flashlight.cs inherits from . Please check the base variables.
magazineCapacityAdded: Capacity to add to the default magazine. If this magazine supports less bulletst than the original, set a negative value.
Magazine.cs inherits from Attachment.cs. Please check the base variables.
You can define custom variables and functions for Stocks if you need them.
Stock.cs inherits from Attachment.cs. Please check the base variables.
Updated in 1.3.6
PlayerMultipliers can be used to create custom Power-Ups.
damageMultiplier: Used by WeaponController to determine Damage Power-Up.
healMultiplier: Used by the PlayerStats to determine Heal Power-Up.
playerWeightMultiplier: Used by PlayerMovement to determine Weight Power-Up
HOW TO CREATE CUSTOM MULTIPLIERS / POWER-UPS.
First, we need to add a new variable in PlayerMultiplier.cs
. We'll name it playerSpeedMultiplier
. Keep in mind that creating custom multipliers or power-ups can be very specific, so this tutorial will not cover the exact steps or requirements for your case.
To define the default value for playerSpeedMultiplier
, set it to 1, since it acts as a multiplier (i.e., currentSpeed * playerSpeedMultiplier = currentSpeed
when playerSpeedMultiplier
is 1).
For a variable like playerSpeedAddition
, which represents an additive value, set its default to 0. This ensures that currentSpeed + playerSpeedAddition = currentSpeed
when playerSpeedAddition
is 0.
Now, let's determine the default value for this new variable.
Locate the section in your code where a multiplication operation is required for your Custom Power-Up to function. Use your custom multiplier by referencing the PlayerMultipliers
script.
If you need assistance, feel free to reach out for support!
PlayerMultipliers.cs can be found inside the same script.
supressedFireSFX: SFX played instead of the original Fire SFX. You cannot leave this unassigned.
uniqueMuzzleFlashVFX: You can leave this unassigned to use the default muzzle flash VFX on your weapon scriptable object
Barrel.cs inherits from Attachment.cs. Please check the base variables.
The FPS Engine utilizes two distinct state machines: one dedicated to player movement and the other managing the weapon system. Within this folder, you will find all the various player states implemented in the FPS Engine, alongside the corresponding state machine logic.
Allows interaction between the Player ( Thanks to the InteractManager ) and this object.
Using Interactable.cs, there are different ways you can achieve custom interactions, simple and advanced.
Attach the component to your interactable object:
For simple interactable objects assign the Interactable Component to an object with a box collider, you can subscribe to the OnInteract event to add your custom behaviour.
For advanced interactable objects:
Create a new C# script.
This new C# script must inherit from Interactable.cs
override the base Interact method from Interactable.cs
Ensure the Interactable Layer is assigned to the same object that contains the Collider & Interactable Component ( or script that inherits from it )
For the Interactable.cs:
interactText
interactableEvents
instantInteraction: If true, Progress Required To Interact from InteractManager will be overrided and set to instant interaction only for this interactable.
player ( Transform ) | Protected ( only accessible from scripts that inherit from Interactable.cs )
Player that interacts with the Interactable.
Interact(Transform player) -> Virtual Method
Interact with the Interactable object.
player: Transform that interacts with this interactable
Highlight() -> Virtual Method
Triggers when an Interactable is highlighted.
player: Transform that interacts with this interactable
Unhighlight() -> Virtual Method
Triggers when an interactable is no longer highlighted.
player: Transform that interacts with this interactable
IsForbiddenInteraction is only available in >1.3.6
IsForbiddenInteraction(WeaponController weaponController) -> Virtual Method, Returns a Boolean
Returns whether the interaction is valid or not. Returns false by default, meaning that the interaction can be performed.
weaponController: You can use the WeaponController to access specific components or properties to determine if an interaction is valid, in case you need it.
aimingPosition: Vector3 added to the position of th weapon when aiming with this scoped equipped.
aimingRotation: Rotation of the weapon when aiming with this scope equipped.
Scope.cs inherits from Attachment.cs. Please check the base variables.
Allows the interaction between interactable objects and the player. To set up custom Interactable objects or learning more about them, please check Interactable.cs
This component can be found on the Player object.
mask: Bitmask that defines the interactable layer
weaponGenericPickeable: Attach the generic weapon pickeable object here
attachmentsGenericPickeable: Attach the generic attachment pickeable object here
detectInteractionDistance: Distance from the player to detect interactable objects
progressRequiredToInteract: How much time player has to hold the interact button in order to successfully interact
interactInterval: Adjust the interaction interval, the lower, the faster you will be able to interact
Duplicate Weapon Adds Bullets: If true, when picking up a weapon that already exists in your inventory, you will add bullets instead of the weapon. ( Introduced in 1.3 )
canDrop: Enables and disables the Player´s ability to drop the weapons
droppingDistance: Distance from the player where the pickeable will be instantiated
canInspect: If true, the player will be able to inspect the current weapon.
realtimeAttachmentsCustomizationOnly: Allows the player to equip and unequip attachments while inspecting. It also displays a custom UI for that.
displayCurrentAttachmentsOnly: When inspecting, display current attachments only. Otherwise you will be able to see all compatible attachments through the UI.
events
Renders the InteractManagerREFERENCES Custom Inspector
The Attachment Identifier SO (Scriptable Object) functions similarly to a Weapon_SO. As a scriptable object, an attachment identifier defines a unique attachment, ensuring that no two different attachments share the same identifier.
To create a new unique AttachmentIdentifier_SO, right-click on the Project folder, then select Create → Cowsins → New Attachment Identifier.
Since each AttachmentIdentifier_SO defines a different Attachment, you will find the following variables:
attachmentName: Name of the attachment that will be displayed on pick up UI elements etc
attachmentIcon: Icon (Sprite) of the attachment
pickUpGraphics: Graphics to be displayed for the pickeable object...
You can define custom variables and functions for Lasers if you need them.
Laser.cs inherits from Attachment.cs. Please check the base variables.
Introduced in 1.3.6. Required by the Inventory Pro + Save & Load Add-On
Scriptable Object that defines an Item. From Base FPS Engine, Weapon_SO & AttachmentIdentifier_SO both inherit from Item_SO.
_name: Your item name. Ex: Glock
icon: Custom image of your item
pickUpGraphics: Visuals that will appear on a dropped item.
applyWeight: Velocity will be decreased depending on the weight of the weapon if this is true.
weightMultiplier: Represents the weight of an entire stack of this item.
Item_SOEditor can be found within item_SO.cs
You can define custom variables and functions for Grips if you need them.
Grip.cs inherits from Attachment.cs. Please check the base variables.
A generic Bullets Pickeable Prefab can be found under the following path: Assets/Cowsins/Prefabs/DragAndDropExtras/BulletPickeableGeneric
amountOfBullets: Amount of bullets to add.
bulletsIcon: Icon to display.
bulletsGraphics: Object that will be instantiated on the Pickeable and represents the bullets to pick up.
If you see a "Not Compatible" message on-screen, you won't be able to collect the bullets. This happens if you either don't have a weapon unholstered or your current weapon doesn't use Limited Magazines. Collecting bullets for a weapon with infinite bullets doesn't make sense. To enable bullet collection for your weapon, navigate to the desired Weapon_SO, set LimitedMagazines to true, and adjust the number of initial magazines.
4o
A generic Attachment Pickeable Prefab can be found under the following path: Assets/Cowsins/Prefabs/DragAndDropExtras/AttachmentPickeableGeneric
attachmentIdentifier: AttachmentIdentifier_SO of the Attachment to pick up.
Pickeable.cs inherits from Interactable.cs. To set up custom Interactable objects or learning more about them, please check Interactable.cs
Pickeable.cs defines the basic structure for the rest of the main Pickeables:
events
rotates: Apply rotation to the Pickeable
rotationSpeed: Change the speed of the Rotation effect
translates: Apply vertical translation to the Pickeable
translationSpeed: Change the speed of the Translation effect
image: Image that displays the Pickeable icon
graphics: Parent transform where the graphics will be stored at
A generic Weapon Pickeable Prefab can be found under the following path: Assets/Cowsins/Prefabs/DragAndDropExtras/WeaponPickeableGeneric
weapon: Weapon_SO for this specific weapon
Reworked in 1.3 Update
Oriented at enemies only.
Check some examples of EnemyHealth usage:
_name: Name of the enemy. This will appear on the killfeed
maxHealth: initial enemy health
maxShield: initial enemy shield
If DestroyOnDie is set to false, your object won’t be destroyed once you kill it.
destroyOnDie: When the object dies, decide if it should be destroyed or not.
deathEffect
showUI: If true, it will display the UI with the shield and health sliders
healthSlider: Slider to display the health
shieldSlider: Slider to display the shield
showDamagePopUps: Enables and disables Damage Pop Ups, which appear on hitting enemies.
damagePopUp: Damage Pop Up object, stored at Cowsins/Prefabs/Others
xVariation: Horizontal randomness variation
showKillFeed: If true, it will display the KillFeed UI on eliminating an enemy
events
isDead ( bool ) / Protected ( only accessible from scripts that inherit from Interactable.cs )
Returns true if the enemy is dead
Player ( Transform )
Returns the player transform.
health ( float ) / ReadOnly
Returns the current health of the enemy.
shield ( float) / ReadOnly
Returns the current shield of the enemy.
Start() / virtual function
Update() / virtual function
Damage(float _damage, bool isHeadshot) / virtual function
Damage the enemy.
damage: Damage to apply on damageable´s health.
isHeadshot: Whether the shot landed on critical areas or not.
Die() / virtual function
IDamageable.cs is the core of the FPS Engine's damage system. Any damageable object, from the player to enemies and even destructible props, inherits from IDamageable.cs.
Please notice IDamageable is an interface. Learn more about interfaces in the official Unity documentation.
Damage(float damage, bool isHeadshot)
Damages the IDamageable.cs object.
damage: Damage to apply on damageable´s health.
isHeadshot: Whether the shot landed on critical areas or not.
Introduced in 1.3.6 and required by the Save & Load Add-On to function properly.
Identifiable assigns a unique ID to objects in a scene, allowing the Save & Load system to track them. Unlike Unity's default object IDs, these remain consistent across sessions.
UniqueIDValue ( string ) | Public Getter, Private Setter
Returns an unique identification string, assigned to that specific object.
Example of EnemyHealth.cs implementation. You can find a training target prefab at Assets/Cowsins/Prefabs/Models/TrainingTarget.prefab
movementDirection: Direction of the movement. Whenever it reaches the end, it will go the opposite direction
directionDuration: Amount of time that the target will keep moving on the same direction
speed: Target velocity magnitude
timeToRevive
Example of EnemyHealth.cs implementation. You can find a training target prefab at Assets/Cowsins/Prefabs/Models/TrainingTarget.prefab
timeToRevive:
Trauma ( Float ) / Public
Controls the intensity of the shake.
instance ( CamShake )
Singleton Reference of CamShak
Shake(float amount, float _power, float _movementAmount, float _rotationAmount)
Shake the camera
amount: Camera Shake amount
power: power of the shake affecting speed.
movementamount: Determines the positional movement during the shake.
rotationAmount: Determines the rotational movement during the shake.
ShootShake(float amount)
Shake the camera for shots.
amount: Camera Shake amount
ExplosionShake(float distance)
Shake the camera for explosions.
distance: Distance from the explosion
instance ( ProceduralShot )
Singleton Reference of ProceduralShot
Shoot( ProceduralShot_SO shot )
Start a Procedural Shot motion given a ProceduralShot_SO ( Procedural Shot Pattern )
shot: ProceduralShot_SO file that contains the information for the procedural shot to be played accordingly.
tiltSpeed: Speed to reach the Maximum Camera Tilt ( tiltAmount )
tiltAmount: Maximum Camera Tilt
headBobAmplitude: Maximum Head Bob
headBobFrequency: Speed to reach the Maximum Head Bob ( headBobAmplitude)
breathingAmplitude: Maximum Breathing Amount
breathingFrequency: Breathing Speed
applyBreathingRotation: Enables Rotation for the Breathing Effect
Crouch Tilt is a Weapon Effect that can be found within the Weapon Prefab. ( Found on CrouchTilt Transform )
tiltRot: Target CrouchTilt Rotation
tiltPosOffset: Target CrouchTilt Position Offset
tiltSpeed: Velocity to reach the Crouch Tilt Position & Rotation
New in FPS Engine 1.2
Merges the Weapon Effects in one place. It can be found attached to the Player.
bobMethod: Defines the bobbing Pattern / Bobbing
gunsEffectsTransform: Guns Effects Transform
speed: Controls the overall speed of the bobbing effect. Higher values result in faster bobbing, while lower values produce slower bobbing.
distance: Defines the amplitude or magnitude of the bobbing effect.
aimingMultiplier: A multiplier applied to the bobbing effect when the player is aiming down sights. This typically reduces the bobbing to provide a steadier aim.
rotationMultiplier: Adjusts the amount of rotational bobbing applied to the gun. This affects how much the gun rotates during the bobbing motion.
translationSpeed: Specifies the speed at which the gun's position changes during the bobbing effect. It controls the rate of positional movement.
rotationSpeed: Specifies the speed at which the gun's rotation changes during the bobbing effect. It controls the rate of rotational movement.
movementLimit: Sets the maximum limit for the gun's movement during the bobbing effect. This constrains how far the gun can move from its original position.
bobLimit: Sets the maximum limit for the bobbing effect itself.
jumpMotion: Animation Curve ( Start Jump Motion )
groundedMotion: Animation Curve ( Stop Jump Motion / Land )
distance: Amount of Jump Motion Effect
rotationAmount: Amount of Jump Motion Rotation
evaluationSpeed: How fast the Animation Curve is played
WeaponEffectsEditor can be found at the end of WeaponEffects.cs
displayGizmos: Displays the Turret detection area in the Editor.
animator: Reference to the Turret Animator that contains the shoot animation.
turretHead: The part of the turret that rotates.
detectionRange: Distance within the player is detectable. If displayGizmos is true this will be visible in the Editor.
allowVerticalMovement: Allow the turret to aim vertically
lerpSpeed: Speed of rotation interpolation
wallLayer: Defines the wall layers so the Turret cannot shoot through them.
projectilePrefab: TurretProjectile to instantiate.
projectileSpeed: TurretProjectile forward velocity.
projectileDamage: TurretProjectile damage on hitting an IDamageable
projectileDuration: Time to destroy the projectile
firePoint: Transform where the Turret will shoot from.
muzzleFlash: VFX to display on shooting.
fireRate: Fire Speed.
player: PlayerMovement Reference
jumpMotion: Animation Curve ( Start Jump Motion )
groundedMotion: Animation Curve ( Stop Jump Motion / Land )
distance: Amount of Jump Motion Effect
rotationAmount: Amount of Jump Motion Rotation
evaluationSpeed: How fast the Animation Curve is played
Adds movement realism to the Weapons ( similar to Weapon lag )
swayMethod: Different Sway Methods, Simple and Pivot Based
amount: Sway Amount applied to the Weapon
maxAmount: Maximum Allowed Sway
tiltAmount: Tilt Amount applied to the Weapon ( Sideways sway )
maxTiltAmount: Tilt Amplitude
pivot: Defines a Transform that acts as a pivot for the effect.
swaySpeed: The higher the value, the faster the effect will be.
swayMovementAmount: Sway Amount applied to the Weapon
swayRotationAmount: Rotational Sway Amount applied to the Weapon
swayTiltAmount: Tilt Amount applied to the Weapon ( Sideways sway )
aimingMultiplier: Modifies the amount of sway applied when aiming
Added in 1.3
Spring Stiffness: Higher stiffness values make the Spring less flexible and more resistant to changes.
Spring Damping: Effect that reduces the amplitude of oscillations
New in FPS Engine 1.2
CowsinsButton extends the base Unity Button class and can be used for MainMenus and UI, provides extended functionalities to switch scenes and sections.
clickSFX: Sound Effect to play on Clicking.
buttonType: Select the behaviour of the button.
SECTION TRANSITION: Allows you enable and disable gameObjects in the UI. You can add a CanvasGroup to these objects to seamlessly play a fade in effect
SCENE TRANSITION: Load new Scenes. Notice that your desired scene must be assigned in the Build Settings. More info.
OTHER: Default Button behaviour.
sectionToEnable: GameObject to enable. You can add a CanvasGroup to this object to seamlessly play a fade in effect
sectionsToDisable: GameObjects to disable. No fade effect is played on these.
sceneIndex: Index of the scene to load.
ProceduralShot_OS defines the characteristics of a procedural shot effect for the Weapons.
This ProceduralShot_SO is a Scriptable Object, and must be placed in the visuals tab of your Weapon_SO ( if eligible to use ProceduralShot_SO, if not, you can disable the feature ).
You can create a unique one for each weapon by right-clicking in your Project folder, going to Create → COWSINS → New Procedural Shot.
playSpeed: Animation Play Speed
xTranslation: Translation on the X axis. The movement follows this Animation Curves from 0 to 1
yTranslation: Translation on the Y axis. The movement follows this Animation Curves from 0 to 1
zTranslation: Translation on the Z axis. The movement follows this Animation Curves from 0 to 1
translationDistance: Effect Amount
aimingTranslationMultiplier: Effect Multiplier when Aiming
xRotation: Rotation on the X axis. The movement follows this Animation Curves from 0 to 1
yRotation: Rotation on the Y axis. The movement follows this Animation Curves from 0 to 1
zRotation: Rotation on the Z axis. The movement follows this Animation Curves from 0 to 1
rotationDistance: Effect Amount
aimingRotationMultiplier: Effect Multiplier when Aiming
ProceduralShot_SOEditor can be found at the end of ProceduralShot_SO.cs
The UI Controller includes several references that are already properly assigned, configured, and equipped with tooltips within the Unity Inspector. These references do not require modification. For clarity, only the customization settings will be displayed here, omitting the predefined references.
If you need help, feel free to contact Support.
BarHealthDisplay: Use Sliders to display player statistics.
NumericHealthDisplay: Use Numbers through text ( TextMeshPro ) to display player statistics.
usingAttachmentColor: Color of an attachment UI element when it is equipped.
notUsingAttachmentColor: Color of an attachment UI element when it is unequipped. This is the default color.
More information regarding Attachments.
lerpXPSpeed: Speed at which the XP bar is filled when collecting XP points.
displayEvents: An object showing death events will be displayed on kill
HideCrosshairOnPaused: Determines whether the crosshair should be hidden when the game is paused.
HideCrosshairOnInspecting: Determines if the crosshair should be hidden when the player is inspecting their weapon.
Size: Defines the length of the crosshair.
Width: Defines the width of the crosshair lines.
Enemy Spotted Width: Defines the width of the crosshair lines when an enemy is spotted.
Defaul Spread: Defines the default spread of the crosshair, indicating the baseline accuracy.
Walk Spread: Adjusts the crosshair spread when the player is walking, reflecting decreased accuracy.
Run Spread: Adjusts the crosshair spread when the player is running, showing increased inaccuracy.
Crouch Spread: Adjusts the crosshair spread when the player is crouching, usually indicating improved accuracy.
Jump Spread: Adjusts the crosshair spread while the player is jumping, typically showing significant inaccuracy.
Default Color: Defines the color of the crosshair in its default state.
Enemy Spotted Color: Adjusts the crosshair color when an enemy is spotted
Resize Speed: Controls the speed at which the crosshair resizes, in response to changes in player movement or actions.
Hitmarker: Enables or disables hitmarkers.
HitmarkerObj: The Hitmarker objet that controls the appearance and behavior of hitmarkers, which provide visual feedback when the player hits a target.
Defines a Rebind UI Button. These objects work alongside the InputManager, since it contains all the rebinding related logic. Please check the MainMenu scene in Cowsins/Demo for more information
inputActionReference: Reference to the Action to rebind. In selectedBinding you can modify the binding to customize.
excludeMouseFromBinding: If True, mouse will not be eligible to be assigned on rebind.
selectedBinding: Allows you to select which binding to rebind. You can display which binding you are currently customizing in the "Input Binding" read only dropdown, under "Path". As you can see, right now we are modifying space, which is part of the Keyboard.I
Static Action Events to subscribe to for triggering various behaviors, typically focused on UI-related actions.
Allows to easily visualize the location of enemies, checkpoints, and more.
camera: Camera Transform Reference. Because the compass is part of the PlayerUI, we always have the Camera Reference available.
compassText: Text to display distance:
compassElementIcon: Prefab already stablished for the CompassElement.
Crate is a Destructible, which implements IDamageable
maxHealth: Initial health of the destructible"
lootInside: Instantiate something cool when the object is destroyed, such as coins, a weapon, or any kind of loot, whatever you want! If this is empty, no reward will be instantiated
destroyedSFX: AudioClip to play on destruction.
destroyedObject: Object to get instantiated when the Crate is destroyed.
Defines a universally visible waypoint for navigation
text: Attach the text where you want the distance to be displayed
measureType: Select a measure unitzamong the following
metres
kilometres
inches
feet
yards
miles
decimals: number of decimals to display ( From 0 to 10 )
updatePeriod: How fast you want the text to display the new distance
Implements from IDamageable, so it can be damaged and destroyed.
maxHealth: Initial health of the destructible"
lootInside: Instantiate something cool when the object is destroyed, such as coins, a weapon, or any kind of loot, whatever you want! If this is empty, no reward will be instantiated
destroyedSFX: AudioClip to play on destruction.
Damage ( float damage, bool isHeadshot )
Damages the IDamageable
damage: Damage to apply on the IDamageable
isHeadshot: Generally false for Destructibles.
Die( )
Destroys the Destructible
minCoins: Minimum Coins to be collected on Trigger
maCoins: Maximum Coins to be collected on Trigger
collectCoinSFX: AudioCLip to play on collecting
The player can collect a Coin and use it to purchase items, etc... Check to discover how to add coins into your game.
The player can collect XP and use it to purchase items, etc... Check ExperienceManager to discover how to add XP into your game.
minXp: Minimum XP to add to the player on collect.
maxXp: Maximum XP to add to the player on collect.
pickUpSFX: AudioClip to play on collect.
onCollect: Event that triggers on collect.
graphics: Graphics object reference
rotates: Apply rotation to the Pickeable
rotationSpeed: Change the speed of the Rotation effect
translates: Apply vertical translation to the Pickeable
translationSpeed: Change the speed of the Translation effect
image: Image that displays the Pickeable icon
graphics: Parent transform where the graphics will be stored at
Inherits from Interactable, since you can interact with the door.
openInteractionText: Text to display for interaction if the door is closed. ( Generally "Open" )
closeInteractionText: Text to display for interaction if the door is opened. ( Generally "Close" )
lockedInteractionText: Text to display for interaction if the door is Locked. ( Generally "Locked" )
isLocked: Whether the door should be locked.
doorPivot: The pivot point for the door
offsetPosition: "The Vector3 to add to the door on opened ( Introduced in 1.3 )
openedDoorRotation: How much you want to rotate the door in degrees
speed: rotation speed
openDoorSFX
closeDoorSFX
lockedDoorSFX
Lock( )
Locks the door so it cannot be opened
UnLock( )
Unlocks the door so it can be opened
ToggleLock( )
If Locked, unlocks it.
If Unlocked, locks it.
Container that holds randomized rewards, such as weapons, power-ups, coins and more. Inherits from Interactable and can be Free or Paid. Check CoinManager for more info.
loot: Array that contains all the possible loot to be instantiated. On interact, a random item will be selected.
price: Price to unlock the Lootbox. Set to 0 for it to be Free.
delayToReceiveLoot: Specifies the time interval between opening the lootbox and receiving the loot.
spawnDistance: Distance to spawn the loot from the Lootbox Position
directionDependsOnPlayerPosition: If true, the loot will be instantiated in fron of the player always. Recommended to be true.
Allows to create PowerUps. Check the current available ones:
reappears: Enables or disables reappearance after being used.
reappearTime: Time to re-enable the power up.
Timer: Image that displays the time remaining to re-appear.
Hurts the player on Trigger.
damage: Damage to deal to the player.
A Hitmarker provides the player with visual and auditory feedback when a hit is successfully landed.
hitmarkerSoundEffect: SFX to play on playing the hitmarker. FPS Engine provides them already.
animator: Allows to play an animation for enhanced feedback.
image: Assign the Hitmarker Image. Headshots will display a Red Hitmarker.
Displays valuable game information. It can be found within the PlayerUI
showFPS: A boolean variable indicating whether the Frames Per Second (FPS) counter is displayed on the screen.
fpsRefreshRate: Defines the frequency at which the FPS counter is updated
FPS Object: TextMeshPro Text that displays all the FPS
showMinimumFrameRate: Defines whether the minimum recorded frame rate should be displayed.
showMaximumFramerate: Defines whether the maximum recorded frame rate should be displayed.
appropriateValueColor: Defines the color used to display FPS values that are considered acceptable or optimal. Typically, this color is green, indicating good performance.
intermediateValueColor: : Defines the color used to display FPS values that are considered average or moderate. This color is usually yellow or orange, indicating medium fair performance.
BadValueColor: Defines the color used to display FPS values that are considered poor or suboptimal. This color is typically red, indicating bad performance.
Destroys the GameObject after an amount of time.
timeToDestroy: Time To Destroy this GameObject
Introduced in 1.3
Creates a Button that can be dragged. On clicked, it opens a menu with different options that will help you do more in less time with FPS Engine
Disabling DraggableButtonInSceneView is very simple,
Go to the top toolbar and Click on Cowsins/FPS Engine Start Up
Click on "Show Draggable Button in Scene View" to turn it off.
In ExternalButtonRegister.cs you can find all the template code you need.
Take a look at the following code:
As you can see, the button Count is set to 5. The original button count for the Draggable Menu is 4, since there are 4 buttons. As we are adding a new button, we must update the button count to 5.
This is the code necessary to add a new Button.
First we gather the Texture or Image we want to display on the button. Change "Assets/CustomButton.png" with your own path.
Inside the creation of the Rect, make sure 5 corresponds to the current button index being added, in this case, it is correct, as we are making a 5th button. GetButtonPosition(menuRect, 5) Inside the if statement, you can add all the code you need to perform on clicking the button. Right now, it only displays a message.
Handles the Paused Game state. By default, you can pause and unpause the game by pressing Escape key ( Esc ) or Start on Controllers.
It can be found within the Player UI.
PlayerUI: Reference to the entire Player UI object.
DisablePlayerUIWhenPaused: Enables or disables the Player UI when the Game is paused. Recommended to be true
Menu: CanvasGroup that represents the Pause Menu
FadeSpeed: Speed at which the fade effect is played for both fading in and fading out.
Instance ( PauseMenu ) / Public Static Singleton
PauseMenu Singleton
isPaused ( bool ) / Public Getter, Private Setter, Static
Returns whether the game is paused or not
UnPause( )
Resumes the game
TogglePause( )
if Paused, unpauses the game.
If Not Paused, Pauses the game.
QuitGame( )
Exits to desktop
When the Player steps on the JumpPad, they will be propelled according to the specified parameters and settings.
forceModeType: Specifies the Jump Method.
PlayerOrientation: player will be launched based on the forward orientation of the camera.
PlayerMovementDirection: player will be launched based on the movement direction.
JumpPadLocalAxis: player will be launched based on the forward orientation of the jump pad.
verticalForceMagnitude: Defines the strength of the force applied in the vertical direction when the Player steps on the JumpPad. This value determines how high the Player is propelled upward.
horizontalForceMagnitude: Defines the strength of the force applied in the horizontal direction when the Player steps on the JumpPad. This value determines how far the Player is propelled horizontally.
jumpSound: Represents the sound effect played when the Player steps on the JumpPad.
Allows the Player to Capture a Point and perform custom events.
captureSpeed: how fast the point will be captured
loseProgressIfNotCapturing: If true, progress will gradually be lost when player leaves the point
losingProgressCaptureSpeed: Speed of progress loss
events
OnCapture( )
This is called whenever you capture the point
Since it is a public virtual void, you can override this method on a new script that inherits from PointCapture. However, do not forget to use
base.OnCapture();
if you still want to perform the base actions on that new script, which is recommended.
Attach this component to any GameObject with a Collider to avoid Collisions with the Player
Trigger allows you to detect Trigger Collisions of an object with the Player, and perform behaviours in response.
You can subscribe any behaviour you want to each of the provided events from the Inspector:
events:
onEnter
onStay
onExit
Defines a Compass Element that appears on the Compass. Check TrainingTarget Prefab, for instance.
icon: Icon to display on the compass.
addOnStart: Adds the compass element to the compass on start
Add ()
Adds this Compass Element to the Compass
Remove ()
Removes this Compass Element from the Compass
ExplosiveBarreli s a Destructible, which implements IDamageable
explosionRadius: Defines the radius of the explosion, indicating how far the impact of the explosion reaches from its center. Measured in units
explosionForce: Specifies the force exerted by the explosion, affecting objects within the explosion radius.
hurtPlayer: A boolean variable indicating whether the player character is affected by the explosion.
damage: Represents the amount of damage inflicted by the explosion on IDamageables
destroyedSFX: AudioClip to play on destruction.
destroyedObject: Object to get instantiated when the Crate is destroyed.