Search Unity

SetTrigger Animation not activated from button onClick

Discussion in 'Animation' started by chaihaolin2002, Aug 15, 2020.

  1. chaihaolin2002

    chaihaolin2002

    Joined:
    Aug 13, 2020
    Posts:
    2
    Pls HELP!

    I am a starter to Unity, and I am trying to make a button that animates into different forms. I am trying to achieve this by having the button invisible (color alpha set to 0) and using several different image elements (Named Circle, Cross and Check) under the button for the visuals.

    My animations are triggered by triggers, and they are functional when clicking on the circle in the "Animator" tab's parameters.

    I set up the button's onclick through the UI's system. Note that I am trying to trigger all three images in each button press, with all of the triggers having the same name, not sure if that is the cause of any problem:

    My problem is that when I play and click on the button, no animation actually occurs. I am not sure if this is a problem of the button not activating or a problem of how I set up the button onclick.

    Here are some of the things that I have already tried:

    Made sure that the "Interactable" option is checked for the button.

    Putting the Sort order of the Canvas to 950, higher than everything else.

    Made Canvas group Interactable. and blocks raycasts.

    Making sure that the button is correctly positioned and sized to cover the images under.

    Made sure Canvas has no parent elements.

    Using custom scripts and functions to setTrigger (might have not worked because of my poor coding skills).

    I have spent my entire day on trying to figure out what the problem is, and confronted help from some of my friends but yet found nothing! I am desperate for some information!!
     
  2. chaihaolin2002

    chaihaolin2002

    Joined:
    Aug 13, 2020
    Posts:
    2