Forum rules - please read before posting.

2D Mecanim: combine Change Parameter with Play Custom?

edited April 18 in Technical Q&A

Hi,

I'm using Mecanim to play my 2d tentacle animation and right now I have an "Object:Animate set to Change Parameter" for changing my speed multiplier parameter and the next "Object: Animate to Play Custom" to play my clip.

I'm wondering if I can customize the Object:Animate Action to combine them into 1 action? Is that relatively easy to do?

Comments

  • A custom Action could feasibly do this: the exact code to simply change a parameter and play animation by name is relatively simple:

    myAnimator.SetFloat ("NewSpeed", 0.5f);
    myAnimator.Play ("tentsAnim");
    

    What's the underlying intent? Do you have many such Action combinations to deal with?

    If so, you're probably best off creating an ActionList asset file with the above two Actions, and using parameters to override the animation fields (speed, clip, optionally the animator itself). When needed, you can then use a single ActionList: Run Action to trigger the sequence and set the parameter values at that point.

  • Yes I will play with this as I'm familiar with ActionList:Run. Thank you for the quick response.
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.