Search Unity

Accessing Custom Animated Properties in Playables

Discussion in 'Animation' started by trianglesoup, Mar 7, 2019.

  1. trianglesoup

    trianglesoup

    Joined:
    Jun 9, 2017
    Posts:
    3
    I've been using Mechanim Parameters in conjunction with Custom Animated Properties in Animation clips to drive the weight of a Runtime IK solution and would like to use the same logic on another project I am working on.

    However this project is using playables for all of the animation logic rather than Mechanim. Is there a way to query the float attribute directly from the clip currently being played via playables?

    Thanks a lot
    Toby
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I ran into the same issue when experimenting with IK and playables.

    Other than serializing the curve you want separately from the clip, the only workaround I know of is to put the clip in an AnimatorController with a parameter to control and use an AnimatorControllerPlayable to play the controller and access the value of that parameter