RAIN provides the Entity component as a way to encapsulate attributes, properties or characteristics of the game object it is associated with. This can be done by defining one to many custom elements and/or aspects.
You add Entity elements to any game object you want your AI to detect through its Sensor element. Once detected, the entity can provide the AI with attribute information that describes the game object.
In this next section we will take a look at the work flow for:
From the RAIN menu:
- Select your character or game object in the hierarchy panel of which you like to describe its characteristics.
- Select RAIN » Create Entity. This will add the entity component to your selected game object.
- Select this newly added Entity component in your hierarchy and view the EntityRig component in the inspector panel.
- Note the Entity Name property defaults to the parent object this Entity is associated with.
- The Entities Form property also defaults to the parent game object.
Note: You can show/hide advanced settings by clicking the small gear icon in the upper right portion of the EntityRig.
For more on Entity review Entity.
Adding an Aspect:
- Entity Aspects are added from the EntityRig in the inspector.
- Click the dropdown next the Add Aspect to select the type of Aspect to use.
NOTE: There are two types Visual and Audio. It is important to select the type you will be looking for or Detecting with Sensors. We'll talk a little more about sensors later. Basically, if you are detecting an aspect of visual characteristics you would select Visual and later when adding the sensor to sense this aspect you would again choose Visual. See AI Sensors for more on working with Sensors.
- Once you add the Aspect you can set the Name property. This is the property you reference in your behavior tree or code when detecting with your sensor.
- You can also specify a Mount Point to associate the Aspect with. For example, if the Aspect were used to describe the type of weapon an enemy might have, you could create an Aspect to describe the weapon and mount the Aspect on the characters hand bone.
- With Advanced settings turn on, you have a few additional properties you can define.
- Next steps RAIN Elements and Components