We can now trigger cut scene using a trigger volume - oh the possibilities!
I have play on awake turned off on the Playable Director, but it is still running through the animation when I start the game. Not sure what is happening here… I am using a newer version of Cinemachine, 2.5 I believe, but the play on awake seems to be the same. Any ideas?
[Question]I’m having the same problem: the sequence plays when I start the game even though Play on Awake is unclicked. What can I do?
[Solution] I had my box collider partly in the ground. So the terrain was triggering it!
Thanks for sharing your solution, that was really helpful! I had the same issue.
My solution was to wrap the Play() in an if statement:
This way I can use it in places where there may be enemies or other objects (eg pick ups, etc) and they can pass through without triggering anything, either.
Hello,
Hopefully someone sees this.
My understanding was that when the player’s capsule collider enters the trigger volume of the intro sequence’s box collider, the OnTriggerEnter is called.
So, I tried to trigger the intro sequence without the RigidBody component in the Intro Sequence gameobject. But it did not work. Does anyone know why the absence of a Rigidbody doesn’t allow trigger events?
Thanks!
The RigidBody is the component that actually calculates and reports colissions and triggers. Without a RigidBody, no physics will happen. One or both GameObjects with colliders must have a RigidBody.
Remember to only run it once. Here’s what I did.
Disabling the collider (while only a minor performance improvement in this very simple scene) I feel is a good practice if you only need something to run once.
In a more complex, more active scene, disabling the collider means it’s no longer part of the physics calculations and could be a very nice performance benefit. It also means this method never even gets called again but the real benefit is in the physics code you don’t see running. Very useful if you have lots of loot, etc.
public class CinematicTrigger : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
GetComponent<PlayableDirector>().Play();
GetComponent<Collider>().enabled = false;
}
}
}