NeoFPS and Behavior Designer integration assets
This repository was created using Unity 2018.4
It requires the assets NeoFPS and Behavior Designer.
:::WARNING::: At the current time this integration assumes that you have the [OPTIONAL] items below installed. This should not create errors, but may create warnings. Features not requiring optional components should still work. If you find this is not the case please raise an issue on GitHub.
This integration example is intended to be dropped in to a fresh project along with NeoFPS and Behavior Designer.
-
Import NeoFPS and apply the required Unity settings using the NeoFPS Settings Wizard. You can find more information about this process here.
-
Import the Behavior Designer asset.
-
Clone this repository to a folder inside the project Assets folder such as "NeoFPS_BehaviorDesigner"
-
There is currently a bug that means Global Veriables are not defined at import. To workaround this create a Behaviour Designer Global Variable of type GameObject with the name
NeoFPSPlayer
, see Behaviour Designer documentation. -
[Optional] If you want to play the demo scene with animations you need to import the following free animation pack: Basic Motions FREE Pack
-
[Optional] If you want to see how the integrations work with fully animated soldiers import the (not free, but cheap) Toon Soldiers
This integration provides a number of Behavior Designer tasks that make it easier to integrate Neo FPS into your project. These can be located in the "Actions/Neo FPS" and "Conditional/Neo FPS" categories.
We've tried to make this as self-documenting as possible using the tooltips and documentation strings used in Behavior Designer itself. If you have questions ask them on the Neo FPS Discord.
Included in the Scripts folder is a class to translate Nav Mesh Agent movements to animation inputs, see
SimpleLocomotionAgent
. This monobehaviour can be dropped on your NPCs and it will convert movement into
inputs for your Animator. By default the inputs are:
Move
a boolean indicating if the agent is moving under its own power- 'XVelocity` a relative velocity between 0 and 1 on the x axis
- 'YVelocity` a relative velocity between 0 and 1 on the y axis
The names of these parameters can be changed in the inspector.
By setting up your animation controller to use these inputs you can have your character animate appropriately based on the movements defined in your behaviour tree. The sample scene contains a character that is wired up to use this method. However, you will need the Basic Motions Free Pack for the animations to work. Install this pack.
You can, of course, trigger animations from directly within your Behaviour Trees, or you can integrate your favorite controller.
We've included a simple demo scene, see NeoFPS_Melee_Ragdoll_Demo
. This requires the Basic Motions Free Pack.
The goal of this is to show how to setup a character.
This scene shows simple movement using a NavMesh. The character will rush to the player and attack them (no animation for attack).
If you shoot the player they will die and then respawn a few seconds later.
There is also some demo scenes within the Toon Soldier Scenes
folder. These require the (not free, but cheap) Toon Soldiers.
Since these scenes have a number of enemies and animations they can show off more of what is possible with Behaviour Designer.
The following is a descripton of the basic steps for setting up your own model and animations to use the Behaviour Designer integrations.
- Import your character into the scene
- Ensure that it has a collider
- Add and configure the
AIController
script (this handles things like Death states and allows configuration of the cahracter). - Ensure the NavMeshAgent is setup correctly (if the model didn't have one the simple locomotion agent script will add one)
- Add and configure Neo FPS
BasicHealthManager
- Add and configure Neo FPS
BasicDamageHandler
- Add and configure Neo FPS
SimpleSurface
- Add an
AiBaseInventory
script and add available weapons to it (see `NeoFPS_BehaviourDesigner/Prefabs/Weapons) - Add a Behaviour Tree component and drag
NeoFPS_BehaviourDesigner/Behaviour Trees/Basic Combat Behaviour
into theExternal Behaviour
parameter
You can use any animation controller that can be driven by a NavMeshAgent
. We provide one with the integration here that is driven by the example
behaviour trees in NeoFPS_BehaviourDesigner/Behaviour Trees
. Note, at the time of writing there are a very limited range of animations provided,
We need an animator, contributions are welcome. As noted above, you can download some free animations to provide core movement animations, but even
then we are still incomplete.
If you want to use our animation controller with the animations bundled then do the following:
- Add an Animator component to your model and use the
NeoFPS_BehaviourDesigner/Animations/Core Controller (Override This)
controller - Add the
SimpleLocomotionAgent
script (this converts motion of the NavMeshAgent to input for the animation controller)
To use your own animations using out controller:
- Create an
Animator Override Controller
fromNeoFPS_BehaviourDesigner/Animations/Core Controller (Override This)
- Configure each of the animators in this controller using your own animations