Trigger Zones - Unity Quick Tip

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • A quick tip on making simple triggers with unity events
    Follow me on twitter: / passivestar_
    Join our Discord: / discord

Комментарии • 30

  • @artdesireboutique
    @artdesireboutique 2 месяца назад

    I have spent hours watch YT vids, trying to get interactions working, but finally you have a solution that works! Many thanks.

  • @jeromecormiermusic
    @jeromecormiermusic Месяц назад

    Thank you very very much, this is quite a fundamental tip for many critical uses in Unity and should be taught as such in the software basics 🙏

  • @hermionegreen333
    @hermionegreen333 5 месяцев назад +3

    quick and super informative thank you!

  • @krissosful
    @krissosful Год назад +4

    Awesome tutorial and nice interior result, keep going👏👏

  • @juliestrator
    @juliestrator Год назад +9

    Now I know how to trigger anyone, thanks :)

  • @Takhooo
    @Takhooo Год назад +2

    YOU GOTTA MAKE MORE YOU THE GOAT

  • @elrovlez6440
    @elrovlez6440 3 месяца назад

    Great video! Thanks for sharing.

  • @AetherXIV
    @AetherXIV Год назад

    I don't know how you are so good at blender and coding. nice

  • @hamishdelaforce1048
    @hamishdelaforce1048 2 месяца назад +1

    this helped alot thanks :)

  • @HxsrzStudio
    @HxsrzStudio Год назад

    bro your videos, are super helpful

  • @Nico.desb7
    @Nico.desb7 6 месяцев назад +2

    i get an error saying that the type "Trigger" already contains a definition for "OnTriggerExit". No clue how to solve it, probably because i have other scripts that override this one but i'm too new into coding to solve it for myself.

    • @NadeemM-f2v
      @NadeemM-f2v 23 дня назад

      You use onTriggerExit two times rather than using onTriggerEnter

  • @TheNSproject
    @TheNSproject 11 месяцев назад

    Thank you so much for your video! Do you have a tuto to show a trigger by clicking the object?

  • @RealFUD_dev
    @RealFUD_dev 29 дней назад

    i have a Question how can i make trigger updated every single frame cuz i want make that if you on trigger & press button something happen

  • @setik1337
    @setik1337 5 месяцев назад +13

    Full script:
    using System;
    using UnityEngine;
    using UnityEngine.Events;
    public class Trigger : MonoBehaviour
    {
    [SerializeField] bool destroyOnTriggerEnter;
    [SerializeField] string tagFilter;
    [SerializeField] UnityEvent onTriggerEnter;
    [SerializeField] UnityEvent onTriggerExit;
    void OnTriggerEnter(Collider other)
    {
    if (!String.IsNullOrEmpty(tagFilter) && !other.gameObject.CompareTag(tagFilter)) return;
    onTriggerEnter.Invoke();
    if (destroyOnTriggerEnter)
    {
    Destroy(gameObject);
    }
    }
    void OnTriggerExit(Collider other)
    {
    if (!String.IsNullOrEmpty(tagFilter) && !other.gameObject.CompareTag(tagFilter)) return;
    onTriggerExit.Invoke();
    }
    }

  • @torontogamestudio2991
    @torontogamestudio2991 9 месяцев назад

    Game Changer. Pun Intended

  • @Low_Fidelity_3D
    @Low_Fidelity_3D 11 месяцев назад

    been seeing you all over Godot twitter as of recent while you learn your way around the game engine. Do you think you may start making tutorials/ related videos covering it?

  • @oliver_rocks80
    @oliver_rocks80 6 месяцев назад

    Jump scare warning 1:44 😱

  • @romeo774
    @romeo774 3 месяца назад

    for some reason when i use the destroy after enter feature my sound no longer plays at all. any fix?

  • @damnthishandleistaken
    @damnthishandleistaken Год назад

    Can you make a tutorial on weapon animations next?

  • @0pix.ziplock
    @0pix.ziplock 3 месяца назад

    how to do this with animation?Help please(

  • @DerRattenfänger
    @DerRattenfänger 3 месяца назад

  • @1playfair
    @1playfair 9 месяцев назад

    Guessing this won’t work in 2019.4.40f1 where my game lives 😅

  • @torontogamestudio2991
    @torontogamestudio2991 9 месяцев назад

    Thank you so much, such a useful peice of code, But for the love of God can you please at least pause on the code for once second for me to copy lol

  • @dazimbsdoc69
    @dazimbsdoc69 7 месяцев назад +1

    this is too fast i cant keep even with pausing like at exactly 0:18 you'll see what im talking about.

  • @lucutes2936
    @lucutes2936 4 месяца назад

    creepy