Invector
Last updated
Was this helpful?
Last updated
Was this helpful?
Important: Emerald AI 2024 v1.0.6 or higher is required for Invector support.
To add support for Invector, users will need to import the Invector integration package. This can be found under Emerald AI>Integrations>Invector. There are two versions; chose the one you have the asset for (either Melee or Shooter).
If you are using Invector Shooter asset, you should import the Invector Shooter Integration UnityPackage. It's worth noting that the shooter integration package will also work with Invector's melee weapons.
After you have imported, you will have a scene to test the Invector player. This is located under Integrations>Invector>Shooter>Demo Scenes>Invector Shooter Integration. This scene will have an Emerald AI demo AI that will attempt to fight an example Invector player. You will be able to target, damage, and kill the demo AI. It will also be able to damage and attack the Invector player. There will be two ranged weapons and one melee weapon the player can use to fight the demo AI.
If you are using Invector Melee asset, you should import the Invector Melee Integration UnityPackage.
After you have imported, you will have a scene to test the Invector player. This is located under Integrations>Invector>Melee>Demo Scenes>Invector Melee Integration. This scene will have an Emerald AI demo player that will attempt to fight an example Invector player. You will be able to target, damage, and kill the demo AI. It will also be able to damage and attack the Invector player.
Included with both integration packages are two scripts. These scripts are bridge scripts that allow Emerald AI and Invector to send damage to each other.
The InvectorAIBridge script should go on your AI, if you want it to receive damage from an Invector player. It will automatically take the health values from your AI's Emerald Health Component. You can do this by searching for the InvectorAIBridge script and dragging it onto your AI.
Important: If you do not have a InvectorAIBridge script on your Emerald AI agent, it will not be able to receive damage from the Invector Player.
It is important that you properly setup your AI's Tag and Layer. For this tutorial, and the example Invector scenes, the Enemy Tag and Enemy Layer was used. These are the tags and layers included with Invector. However, you are free to use the ones for your project, just make sure that you have set these up through your AI's Detection Component.
Since the AI are using the Enemy layer, the Enemy layer needs to be added to every AI's Detection Component to allow them to be properly detected.
Important: Not properly setting up your AI's Tags and Layers, as well as setting their layer to the AI's Detection Layer, can cause AI to not be properly detected. Also, ensure you set your Player Unity Tag to Player, which is the default tag that Invector Players come with.
The InvectorPlayerBridge script should go on your Player, if you want it to receive damage from an Emerald AI agent.
Important: If you do not have a InvectorPlayerBridge script on your Invector Player, it will not be able to receive damage from Emerald AI agents.
You will also need to set your Player's faction through the Faction Extension component. For this tutorial, the Player faction is used.
Important: If you skip this step, your Invector Player may be unable to damage Emerald AI agents. Ensure that you set the layers that your project/AI. For this guide, The Enemy layer is used for AI agents and the BodyPart layer is used for Location Based Damage parts.
Upon applying the InvectorPlayerBridge to your Invector Player, you will need to set the Transform Source for the Target Position Modifier. See the for tutorial on doing this.
Your Invector Player's Shooter Manager needs to have the layer of your AI add to its Damage Layers. If your AI is using a , you will also need to have these layers added to the Damage Layers. Invector recommends using the BodyPart layer for internal colliders.
This concludes the tutorial. Test your Invector Player and AI to ensure everything works correctly. If something doesn't work, go through the tutorial to ensure no steps were missed. You can also test the included Invector example scenes to see how everything was set up. Feel free to reach out on if you need assistance.