Search Unity

How to add an object to another object on animation event

Discussion in 'Animation' started by EDORlON, Aug 8, 2019.

  1. EDORlON

    EDORlON

    Joined:
    Aug 8, 2019
    Posts:
    1
    I have a Animation controller with my character model, and I want that when an animation event is triggered, my model is added on the right and, and when the other trigger is activated, remove the model.

    That's all basically, I'm trying to do this for like 4 hours and it's driving me crazy...

    Any idea
     
  2. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    130
    Why not just position the object on the right and SetActive(false). When you're ready to trigger the event, SetActive(true) to the object. For the "other", just SetActive(false) again.

    Just do it at the same place that you're triggering the animation event.


    Sorry, I don't know much about Animation Events. Perhaps this will help:

    https://answers.unity.com/questions/1245346/how-can-i-enable-a-gameobject-with-an-animation-ev.html
     
    Last edited: Aug 11, 2019