Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Activate a Unity Timeline from a trigger
using UnityEngine;
using UnityEngine.Playables;
public class GenericTrigger : MonoBehaviour
{
public PlayableDirector timeline;
// Use this for initialization
void Start()
{
timeline = GetComponent<PlayableDirector>();
}
void OnTriggerExit(Collider c)
{
if (c.gameObject.tag == "Player")
{
timeline.Stop();
}
}
void OnTriggerEnter(Collider c)
{
if (c.gameObject.tag == "Player")
{
timeline.Play();
}
}
}
@jaaacccobdev

This comment has been minimized.

Copy link

@jaaacccobdev jaaacccobdev commented Jul 28, 2021

when my player walks to the trigger nothing happens can you help please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment