Timelines: Composing Timelines with Collision Behaviors
We can use Behaviors in a parent scene to trigger Timelines in a child scene.
The OnCollision Behavior in Reality Composer Pro can be a useful way to trigger a timeline based on something happening within a scene. As an example, when Entity A reaches and collides with Entity B, play a sound effect or show some particles.
We saw that we can compose timelines from other timelines. We can even call timelines from child scenes. Working with Collision Behaviors can force us to consider how to structure our scenes and child scenes. The component that handles the Collision must have access the other entity with a Collision Component. These don’t need to be in the same file though.
Let’s start with a child scene. We’ll add an Entity and a Timeline that can show a visual effect when it runs. In this case we’ll use the Show and Hide actions to control a Particle child entity.

We can drag this scene into our parent scene. We’ll add Behaviors component to the Base Entity and select the OnCollision trigger. This will prompt us to select an entity with a Collision Component. We’ll choose the ToyBiplane from our child scene. We also need to select the Timeline that will run when the collision happens. We’ll choose the ReachBase timeline from the child scene.

We can repeat this for as many entities and child scenes as we need. To recap
- Parent scene contains an entity that controls the
OnCollisionBehavior - Child scene contains an entity and any timelines internal to this file. These timelines can be called from the Parent scene.
Support our work so we can continue to bring you new examples and articles.
Download the Xcode project with this and many more examples from Step Into Vision.
Some examples are provided as standalone Xcode projects. You can find those here.

Follow Step Into Vision