JU TPS Documentation
  • 🤩Welcome to JU TPS
  • 😄Quick Start
    • How to start a new scene
    • How to create a JU Character / Reskin Default Character / Setup New Characters
      • Ragdoll
      • Damageable Body
      • Physical Damage
      • Body Leaning Setup
      • Taking Damage / Healing
      • Footstep System
      • Resizable Capsule Collider
    • 📦 Addon Installer
  • 🎮Game Development
    • Game Styles
      • Third Person Shooter Style
      • First Person Shooter Style
      • Top Down Style
      • 2.5D Sidescroller Style
      • ⚠️Important Info About Cross-Plataform
    • Controls / Inputs
      • JU Input Manager
      • Input Events
    • How to create a Mobile Game with JU TPS
      • Mobile Inputs
    • How to load scene
      • Scene Controller
    • How to use Cover System
    • How to use inventory and add items
      • Inventory in UI
      • How to switch between items
      • How to align weapon rotation
    • How to create weapons and items
      • Prevent gun clipping through walls
      • Creating Projectiles/Bullets
    • How to use Dual Wielding System
    • How to use Armor/Cloth System
    • How to use Vehicle System
      • Standard Vehicle Configuration
      • How to create a Car Controller
      • How to create a Motorcycle Controller
      • Vehicle Engine Sounds
      • Coding Custom Wheeled Vehicles
      • How to enter and exit from a vehicle
    • How to use Gravity Switching
    • How to use Actions/Skill and Animation Events
      • JU TPS State Machine Behaviours
      • JUTPSActions Lib Scripting Reference
    • Camera State Trigger
    • How to use Enemies AI
    • How to use Vehicles AI
  • ⚙️Tools, Utils and Tutorials
    • General Tutorials
      • How to do Ragdoll Fall with Input Event
      • How to disable FPS Aim Mode / Scope / Iron Sight Aim
    • Auto Scripts
    • Icon Generator Tool
    • Destructible Objects System
      • Fracture Generator Tool
    • Pixel Quality Scaler
    • Camera Shake
    • Slow Motion
    • Gizmo Drawer
  • ▶️Video Tutorials
    • How to use JU TPS
  • 💬Discord Community
  • ❓Support | Help
  • 📍Roadmap
  • 🔃Change Log
  • 📦Official Addons
Powered by GitBook
On this page
  • First Steps
  • Basic Holdable Item Setup
  • General Holdable Item Setup
  • Weapon Item Setup
  • Melee Weapon Setup
  • Damager
  • Throwable Item / Granade Setup
  • Explosion Effect
  1. Game Development

How to create weapons and items

PreviousHow to align weapon rotationNextPrevent gun clipping through walls

Last updated 1 year ago

First Steps

1- Place Item Model in Scene and Unpack Prefab

2- Set layer to "Item" layer

3- If you want use Drop System and Pick Up System, add a Collider and RigidBody

4- Add any of the components below, configure it and create the prefab by dragging it to a folder in the Project window.

Basic Holdable Item Setup

In JU TPS there are some types of ready-made holdable items, they are: General Holdable Item, Weapon, Granade and Melee Weapon

All holdable items will have the essential parameters below, this means you can repeat the first steps for all holdable items

Parameters
Description

Unlocked

When checked, the item is ready to be equipped and used

Item Name

Name of how the item will appear in the inventory, it is also required for other actions such as Pick Up

Item Switch ID

Index for the Item Switch System, it is automatically set when the game starts, as the value must be according to the position in the hierarchy

Item Filter Tag

Item Icon

Icon of the Item that will appear in the inventory and in the "Current Item Information" present in the default UI templates

Item Quantity

Quantity of items, if it is 0 the item will be blocked

Item On Body

Visual 3D model of the Item on the body, it is used to distribute the items on the body when not in use, not necessary if you don't want to

Single Use Item

When used the item will be locked.

Continuous Use Item

With this option, while the use button is being pressed, the item's use function will be called at each Frame

Block Fire Mode

For items that don't need Fire Mode to work, like grenades and melee weapons, which can block Fire Mode to work properly

Hold Pose

List of poses to hold item while not in Fire Mode

Push Item From

Basically the animation of equipping the item

Item Wielding Position ID

Is Left Hand Item

This is to differentiate if the item is left hand item

Force Dual Wielding

The Item when equipped will activate the "Dual Item to Wielding" in the left hand and they will work together.

Dual Item To Wielding

Item in left hand to be activated when Item in right hand is equipped for Dual Wielding System to work.

Left Hand Position

A GameObject that stores the position and rotation of the left OR right hand wielding the item ⚠ Example: the left hand supporting the right hand on the pistol

General Holdable Item Setup

It has no differences from the default holdable items settings other than events that you can use to call functions from code or simple actions like turning a light on and off:

Weapon Item Setup

The Weapon Component has some unique parameters that you will need to configure:

Precision System Parameters
Description

Accuracy

It's accuracy speed, the higher the faster the weapon will regain accuracy after a shot and the faster the crosshair on the screen will move.

Loss of Accuracy per Shot

The higher it is, the less accurate the gun will be on each shot. It is recommended to leave it at a low value (like 0.1 - 1).

Shooting System Parameters
Description

Shooting Position

GameObject that keep the position where the bullet is instantiated, is also used to calculate the direction of the bullet.

Bullet Prefab

Prefab of Bullet

Muzzle Flash Prefab

Prefab of Muzzle Flash Effect

Fire Mode [ Auto, Semi Auto, Bolt Action, Shotgun ]

Auto: Machinge Guns Semi Auto: Pistols Bolt Action: Snipers Shotgun: Shotguns

Aim Mode [ Camera Aproach, Scope Texture ]

Weapon sight type

Camera Aiming Position

Camera position while aiming.

Camera FOV

Camera Aiming FOV

Fire Rate

Shooting fire rate

Bullets in the Gun

Bullets loaded in the magazine

Total Amount of Bullets

Total bullets stored of the weapon

Bullets for Reload

Number of bullets per magazine

Number of Shotgun Bullets per Shot

Number of bullet instances per shot in a shotgun

Procedural Animation Parameters
Description

Enable

Enable procedural weapon animations.

Weapon Position Speed

Speed at which the weapon returns to its original position after a shot.

Weapon Rotation Speed

Speed at which the weapon returns to its original rotation after a shot.

Recoil Force

Force at which the gun pushes the hand back after a shot.

Recoil Rotation Force

Force at which the gun rotates the hand after a shot.

Camera Recoil Multiplier

Force that the recoil affects the direction of the camera.

Slider Movement Axis

Axis of movement of the weapon slider.

Gun Bolt/Slider

Weapon Slider GameObject

Bolt/Slider Movement

The distance the Slider will be pulled back after the shot.

Bolt/Slider Speed

Speed at which the Slider will return to its original position.

Bullet Casing

Bullet casing, can be a GameObject to instantiate or a Particle System(you have to check the option below to use Particle System)

Is Particle System

Bullet casing is a Particle System

Weapon Audio System Parameters
Description

Shot Audio

Shot Audio Clip

Reload Audio

Reload Audio Clip

Weapon Equip Audio

Equip Audio Clip

Empty Magazine Audio

No Ammo Audio Clip

Melee Weapon Setup

Melee weapons are simple:

Melee Weapon System Parameters
Description

Attack Animator Parameter

Parameter that triggers the sequence of attacks by the JU Character animator. So far by default there are three parameters in Animator: OneHandMeleeAttack, TwoHandMeleeAttack and DualHandMeleeAttack

Enable Health Loss

Enable health to item

Health

Health value

Damage Per Use

Damager

Damager is a script that basically works to damage any GameObject with JU Health Component.

Needs a collider and a rigidbody to detect collisions.

Damager Parameters
Description

Damage

Damage

Disable On Start

Disable GameObject on game start

Hit Min Time

Delay to hit again after a hit

Raycasting Mode

This mode does not need a collider or a non-kinematic rigidbody.

Raycast Collide With

Raycast Layer Mask

Raycast Distance

Raycast Distance

Ignore All Colliders of Root GameObject

Ignores all colliders of the root GameObject (this is to ignore the player's body colliders for example and not damage itself)

Lock Start Position

As the Damager needs a non-kinematic rigidbody to detect collisions, it is normal for it to physically move, this option locks the local position of the Damager

Tags To Damage

All tags listed here will receive damage on collision with the Damager (the object being collided needs a JU Health)

Hit Particles List

Particle and audio effects for each tag

Hit Sounds Audio Source

Audio Source to play audio clips

Throwable Item / Granade Setup

The Grenade Component is basically the Throwable Item Component with an explosion option:

Throw Parameters
Description

Animation Trigger Parameter

Throw Force

Throw Force

Throw Up Force

Throw Up Force

Rotation Force

Throwed Object Rotation Force

Seconds To Destroy

Seconds to destroy after being thrown.

⚠ Set the value to 0 if you don't want the object not to be destroyed

Position To Throw

Throw Position (Pay attention to Gizmos)

Direction To Throw

Throw Direction (Pay attention to Gizmos)

Explosion Parameters
Description

Explosion Prefab

Prefab with the explosion effect

Time To Explode

Time for the grenade to explode

Time To Destroy Explosion

Time that the explosion effect will visually last

Explosion Effect

You should use this when you want to differentiate between types of items, to filter what can be equipped in an . ⚠ Example: Primary Weapon, Secundary Weapon[...]

Wielding position index during FireMode (You can see IDs in )

To Enable

Gameobject to enable when using melee weapon.

When the collides, the weapon takes damage

Parameter that will be called in the JU Character animator to throw the object. ⚠ Note that throw function is called by a

The explosion effect can be equipped with the Explosion Component which can physically simulate an explosion and deal damage to characters. It's also interesting to put the Shake One Time component in the explosion, it will do the (Make sure you have a assigned to your Camera)

🎮
Camera Shake effect
Shaker
JU Animation Event
Damager
Damager
Damager
Item Aim Rotation Center
Inventory Slot
Grenade component as an example of a holdable item