Sharing Behaviors between multiple Entitiy Types

You have set a lot of Entity Types and you don't want to go into the painful process of copying each behaviors for each entityTypes, here is a quick workflow to share a Behavior Container between Entity Types.

For our example, we would mix both crowdMan and crowdWoman from the Character Pack.


1. Create two Entity Types  and load the crowdman in the first one and crowdwoman in the second one.

2. Click on the Population Tool icon  then click in the center of the scene to place population around it. Map both entityTypes in it and let the weights repatition to 50/50.

3. Adjust the placement settings and click the Create button to emit your particles. Your entities are now placed.


4. Go inside the Entity Type 2 (woman) Attribute Editor and change the "In Behavior Container" attribute to use the Entity Type 1 container (man). You won't have to worry no more about editing the crowdWoman Behavior Container.

5. Open the Behavior Editor  and drag and drop a Motion Behavior, load a motion clip in it.


6. For crowdWoman and crowdMan uses a similar skeleton mapping, setting the Motion Mapping to Automatic for the Locomotion Behavior or Motion Behavior should be okay to play the same set of motions.

7. Play your simulation, both men and women should play the same animation.


Sometimes you would like to play a set of animation on on entityType and not on the other one. Here is how to split Behaviors by Entity Types while they share the same Behavior Container.

8. Open the Behavior editor and drag and drop an If operator on the Behavior Flow.

9. Drag and drop two Motion Behaviors behind the If Operator so they are both connected to it.

10. Go inside the Condition Trigger Container of the If operator and drag and Drop an Expression Trigger  in it. 

Open the Expression Trigger attributes and set it to start when the Entity Type is 2.  (this.entityTypeId == 2.000)

11. Play your simulation, men and women would play two different motions.