Controls:
WSAD - move;Space - sprint;
Right mouse button - aim;
Left mouse button - fire;
F - disarm;
1, 2, 3 alpha keys - arm weapon;
R - reload firearm.
V - change fire mode (only rifle);
B - open firearms menu.
G - drop firearm.
ESC - open main menu;
Description:
This package might be used as a template to create third person shooters.This package contains:
1. Animations.
All animations and models are in FBX format and if you need only animations, then your can use them in any version of Unity. All of them are retargetable to humanoid rigs.
- holster/unholster;
- reloading;
- aiming;
- shooting.
2. Scripts.
All scripts are in C#.
- basic character controller;
- character-weapon interaction (aiming, firing, picking up, dropping, holstering/unholstering, reloading);
3. Models.
All models is very simple and meant to be replaced by your own art.
- basic character;
- basic pistol;
- basic rifle;
Set up character guide.
This guide will help you to set your own character, the same as in the Firearms DemoScene. Firearms DemoScene is located at "Assets > Irish cream Interactive > Character-firearm Animations".- Create a new scene ("File > New Scene").
- Delete gameObject "Main Camera".
- Create a floor for your character ("GameObject > 3D Object > Plane" or place your own environment in scene).
- In the Project Window go to "Irish cream Interactive > Common > Prefabs" and find "Character Template" prefab.
Drag & drop to the floor "Character Template" prefab. - Drag & drop to Hierarchy view "EventSystem" prefab witch located at "Assets > IC Interactive > Сommon > Prefabs";
- Drag & drop you character model to "Character Template" gameObject in Hierarchy view.
Note, your character should have correct Humanoid rig and should have "Animator" component after you place it in the scene. - Parent "Character template > *ParentThisTo_..." gameObjects to corresponding transforms (root, left hand, head, right hand and upper spine of your character's model).
- In the Project Window go to "Irish cream Interactive > Common > AnimatorControllers" and find "Human" animator controller.
Assign animator controller "Human" to your character. - In the Project Window go to "Irish cream Interactive > Common > Scripts > Character".
Assign scripts "AnimatorEvents", "AnimatorMovement", "IKController" to your character gameObject. - In the Hierarchy window go to "Character Template > Physics", find script "Character".
Drag & drop your character gameObject to variable "Animator" of script "Character". - In the Hierarchy window go to "Character Template > Physics".
Remove component "Skill". - In the Project Window go to "Irish cream Interactive > Character-firearm Animations > Scripts".
Find scripts "SkillFirearms", "FirearmAssigner".
Assign scripts "SkillFirearms", "FirearmAssigner" to "Character Template > Physics". - In the Project Window go to "Irish cream Interactive > Character-firearm Animations > Prefabs".
Find "Pistol", "Rifle" prefabs.
Drag & drop to the floor "Pistol", "Rifle" prefabs. - Go to script "FirearmAssigner".
Drag & drop "Pistol" to variable Pistol.
Drag & drop "Rifle" to variable Rifle. - Enter play mode.
!!!WARINIG!!! DO NOT EXIT PLAY MODE before you copy "Character Template" gameObject!!! - Go to "Character template > Physics".
Find script "Input Manager".
Set variable "Debug Aim On" of script "Input Manager" to true. Now you don't need to hold right mouse button to aim, just press. - Go to "*ParentThisTo_UpperSpine > FirearmsPositions > Rifle > Rifle Spine Slot > Rifle".
In script "Firearm" set variable "Debug Aim" to true. - In Game window press "Play" button.
- Press key "1" on alpha keybord to unholster rifle.
- Press right mouse button to aim.
Do not shoot yet! - Enable "*ParentThisTo_UpperSpine > FirearmsPositions > Rifle > Rifle aim > RifleModel".
- Enable "*ParentThisTo_UpperSpine > FirearmsPositions > Rifle > Rifle Spine Slot > RifleModel".
- Edit position of transform:
"*ParentThisTo_UpperSpine > FirearmsPositions > Rifle > Rifle aim".
Edit position and rotation of transforms:
"*ParentThisTo_UpperSpine > FirearmsPositions > Rifle > Rifle aim > RightHand".
"*ParentThisTo_UpperSpine > FirearmsPositions > Rifle > Rifle aim > LeftHand".
"*ParentThisTo_UpperSpine > FirearmsPositions > Rifle > Rifle Spine Slot".
"*ParentThisTo_RightHand > Rifle Hand Slot".
"*ParentThisTo_LeftHand > RifleClip".
Copy "Character Template" gameObject (right click on it in Hierarchy view > Copy). - Exit play mode.
- Paste "Character Template" gameObject.
- Copy and paste transform component from every edited transforms of copy to your original character (right click on component > Copy Component, right click on other component > Paste Component Values).
- Drag & drop "Character Template" to your prefab folder to make a prefab.
- Save scene.
- Do the same for pistol positions if needed.
Set up firearm guide.
- Open scene from "Set up character guide".
- Drag & drop your firearm model to gameObject "Rifle".
- Edit transforms of your firearm model, if needed.
- Disable gameObject "Rifle > Model".
- Select gameObject "Rifle".
In script "Firearm" set variables:
Model Name - your firearm name.
Min/Max Rifle Rotation/Translation - recoil in degrees and meters;
Available Fire Modes.
Fire Rate RPM - in rounds per minute.
Sounds for shoot, reload and empty.
Muzzle Velocity - in meters per second.
Rounds Count - how much rounds in firearm at start.
Round Capacity - magazine capacity of the firearm. - Rename gameObject "Rifle" after your firearm name.
- Drag & drop your firearm gameObject to your prefabs folder to make prefab.
- Go to "*ParentThisTo_UpperSpine > FirearmsPositions"
Duplicate "Rifle" gameObject
Name duplicate after your firearm name. - Go to "*ParentThisTo_RightHand"
Duplicate "Rifle Hand Slot" gameObject
Name duplicate after your firearm name. - Place your magazine model in "*ParentThisTo_LeftHand" gameObject.
- Go to "Character template > Physics".
Find script "SkillFirearmsVariables".
Go to variable "Weapons", change size to add element for your firearm.
In your element of variable "Weapons" assign variables: Name - your firearm name.
Aim - "*ParentThisTo_UpperSpine > FirearmsPositions > (your firearm name) > Rifle aim".
Left Hand Aim - "*ParentThisTo_UpperSpine > FirearmsPositions > (your firearm name) > Rifle aim > LeftHand".
Right Hand Aim - "*ParentThisTo_UpperSpine > FirearmsPositions > (your firearm name) > Rifle aim > RightHand".
Left Hand Armed - "*ParentThisTo_RightHand > (your firearm name) > LeftRifleArmed".
From Rifle To Cam Target - "*ParentThisTo_UpperSpine > FirearmsPositions > (your firearm name) > fromRifleToCamTarget".
Slot Spine - "*ParentThisTo_UpperSpine > FirearmsPositions > (your firearm name) > Rifle Spine Slot".
Slot Hand - "*ParentThisTo_RightHand > (your firearm name)".
Magazine In Hand - "*ParentThisTo_LeftHand > (your magazine model)"
Magazines Count - how much magazines at start.
Slot Index - 0 - two handed wielding; 1 - one handed wielding. - Go to "Character template > Physics".
In script "Firearm Assigner" change size of variable "Firearms" to add new element.
This adds new category of firearms.
Name new category, for example "Rifles". - Drag & drop your firearm gameObject to variable "Sub Firearms".
- Now you can assign your firearm to character from menu in play mode. Press "B".
You also can assign your firearm from script "Firearm Assigner". Just call function "AssignFirearm(int categoryIndex, int FAIndex)". - Edit transforms as described in Set up character guide after entering play mode if needed.
Warning: include(footer.html): Failed to open stream: No such file or directory in C:\xampp\htdocs\packages\ic-third-person-shooter-template.php on line 164
Warning: include(): Failed opening 'footer.html' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\packages\ic-third-person-shooter-template.php on line 164