Forum rules - please read before posting.

First Person Close-Up Variable to Animator issue

edited January 2022 in Technical Q&A

Hello, I'm working on a first-person puzzle game for the Global Game Jam this weekend. I managed to get Variable to Animator working correctly for one drawer of a chest of drawers (Top Drawer, when you lick on it it opens and closes) but not the other two which are coded identically. If I switch the Bool manually in the Animator during PlayMode the animations work correctly, and the hotspots of the other two drawers are visible (their labels show when hovering), so I don't understand why clicking on the other two drawers doesn't change the Bool like it does for the top drawer. I've attached some screenshots. The working one is Screenshot1, and Screenshot2 and Screenshot2b are the non-working ones. As you can see, they're all done the same way. Any ideas where the issue may lie?

Screenshots: https://imgur.com/a/XEyVZvX

Comments

  • Welcome to the community, @Elaine_Marley. What is your AC version?

    The details shared in the screenshots look OK - though, the Animator components are collapsed. Are they assigned the correct Animator Controller assets, i.e. cajon_02 has MiddleDrawAnim?

    Check your Console for any related messages or warnings. It's worth noting that you don't need to create a separate Animator Controller and set of animations for each drawer.

    It's necessary in your Hierarchy at the moment because all drawers are parented to the same object - so they each have different relative positions when all closed / all open.

    If you gave each their own parent object, positioned at each drawer's "closed" position, then you could share the same Animator Controller and Animation Clip assets between all three. By this, I mean the hierarchy would be:

    - mueble_cajones
        - parent01
            - cajon01
        - parent02
            - cajon02
        - parent03
            - cajon03
    
  • I found the error! I forgot to set the IsOpen variable Link to Custom Script in the other two drawers. Oh, that's clever about the parenting, I'll use that for similar things.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.