Forum rules - please read before posting.

Disable hotspot while playing specifik animation

Hi, again...

https://imgur.com/17MAkLt
this is the frog idling. when clicked he jumps into the water and after a while he walks up on the rock and goes back to idling.

Right now you can click him and he plays the animation as i want him to do, but you can still click and play his sound over and over while the animation is playing, and you shouldn´t be able to click untill he has returned to idle.

https://imgur.com/SF52jWe
animator

https://imgur.com/5S6JUgO
actionlist editor

this is how it looks right now.
i tried removeobject to remove the hotspot and then adding object hotspot after the animation had played but didn´t get it to work as i wanted.

how should i do this?

Malte

Comments

  • edited August 2019

    Add a Remember Hotspot component to your Hotspot Inspector window, making sure it's set to starts enabled. In your action list add Hotspot: enable or disable nodes at the start and end. Setting them Disable, then Enable respectively. Also Check the tickbox "wait Until Finish" in the Animate Node. That should be it.

  • To also add: set the ActionList's When running field to Run In Background to allow gameplay during this time.

    Two other ways this could be done:

    If you arrange the hiearchy such that the Hotspot and the frog have access to the same animator, you could control the Hotspot collider's enabled state within the frog's animation.

    I expect it would also be possible to make a Timeline to handle the sound, animation, and disabling of the Hotspot GameObject as part of one Timeline sequence, and then have the interaction run a single Engine: Control Timeline Action.

  • https://imgur.com/32hLMTh
    actionlist

    https://imgur.com/OSg5pc4
    inspector

    Now it works as i wanted! thank you JackAnimated and ChrisIceBox.

    Chris
    i did not really understand the first of the other 2 ways.
    arrange the hiearchy in actionlisteditor?
    and which frog/groda do you mean? the gameobject?
    but i understand it as you can work in the animator window to chose which animation to play (obviously) and also enable/disable the froghotspot collider.

    and the seccond way, i looked in the manual on timelines, and it looks like timelines could be real handy to start learning how to use.

  • arrange the hiearchy in actionlisteditor?

    No, in Unity's Hierarchy window. An Animator can animate properties not just on the GameObject it's attached to, but also on it's children. Therefore, if your frog sprite GameObject was parented to your frog Hotspot GameObject (or vice-versa) you could control both the Hotspot's enabled state and the sprite animation from one Animator.

    This isn't really anything to do with AC - just a feature of Unity's own animation system.

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.