Basics
A detailed guide on how to setup the firearm using its wizard.
Last updated
A detailed guide on how to setup the firearm using its wizard.
Last updated
Start by creating a first person controller as mentioned here.
FPS Framework has a wizard for the firearm which makes the process a lot easier. To access the wizard you need to right click your inventory from the hierarchy. Click on the menu Akila, then FPS Framework, then Firearm, like this:
By clicking on Firearm in this menu you should see this window:
Custom Data
The premade data that the firearm should use (If there is)
Name
The name of the firearm to create
Preset
Which type of gun the firearm should be
Custom
If on, you have total freedom on the firearm settings outside of the preset range before the firearm is created, however everything can be changed later.
Select a preset, give the gun a name, and then click Create. A game object with the name you gave it earlier and a firearm data file with the settings specified based on the preset you selected should be created. By default the gun is set to Hitscan which doesn't need anything to be able to shoot.
This is what you should see:
As seen above, there's a new firearm data file in the project window. This new file is the data container for everything in the firearm. Select it and this is what you should see:
The firearm data has 4 sections, each section has a toggle next to it. If the toggle is on, the firearm will apply the settings in that section, otherwise it won't do anything regrading this section.
If you play now you should see the firearm shooting. In some version of FPS Framework, the gun recoil doesn't work by default so you might want to do an extra step to fix this.
Click on your newly created firearm game object and this is what you should see:
As seen above, there's no transform assgined to the field "Recoil Transform" in the firearm component. To fix this you might want to expand the children of the firearm gameobject until you find a game object called "Recoil" assgin it to the field "Recoil Transform" in the firearm. This should fix it.
This is the basic setup, for more details check this page.