Realistic FPS Prefab
This integration provides components that work with the RFPSP asset.
It provides the following items:
These items all work with the setup of RFPSP. For example, if you pickup a weapon, it becomes available as a weapon you can use to shoot; using Food will reduce your player's hunger and boost its health.
To setup your scene to use these items, you need to do the following:
- Define the items you will need, including weapons and ammunition. This is done just like creating normal items through the Main Editor. More details on how to setup items are given below.
- Add the _Managers object to your scene, with all required managers. Also add the following components to the _Managers object:
- Add the following components to your FPS Player object, and configure the collections you will need.
- Add the Weapon component to each weapon under FPS Weapons, and link in the appropriate item definition file for that weapon.
- RFPSP only allows you to have one weapon of each type. To have this same behavior on a collection, you need to add the
WeaponRestrictionBehaviouron your player (next to the creator script), and specify the collection name.
FPSGamecomponent provide a function that toggles pausing the game (which allows you to use the mouse to interact with the UI). Add an action to this method on show and hide for all
UIWindowsthat need mouse interaction. You can also call this function for other purposes.
Tips for setting up items
- Use triggers to make it possible for items to get picked up.
- Do not add any of these scripts to your items:
- Remember to add the type of Ammunition each weapon uses in the item definition.
Running the Demo
- Set the path to the Database in the Main Editor to
Assets/RFPSP Integration/FPS Databases.
- Open the FPS Prefab Sandbox scene in
- Run the game.