Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Resolved Animation Controller example remove movement

Discussion in 'DOTS Animation' started by NT_Ninetails, May 9, 2021.

  1. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    196
    Anyone know who to remove the movement of the Animation Controller example?
    I just need the animations to play.
     
  2. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    196
    I fixed it! It was an issue of the internal systems updating 2 different values but updating the same animation.
    [This is in the Unity.Animation sample's DorectionMixerNode.cs]
    Code (CSharp):
    1.  
    2.             // Setup port forwarding
    3.             ctx.ForwardInput(KernelPorts.Time, m_TimeNode, KernelPassThroughNodeFloat.KernelPorts.Input);
    4.             ctx.ForwardInput(KernelPorts.DeltaTime, m_DeltaTimeNode, KernelPassThroughNodeFloat.KernelPorts.Input);
    5.             ctx.ForwardInput(KernelPorts.Weight, m_WeightNode, KernelPassThroughNodeFloat.KernelPorts.Input);
    6. // added x and y params to mimic a BlendTree but this cause 2 calls to the Execute method
    7.             ctx.ForwardInput(KernelPorts.XParam, m_XParamNode, KernelPassThroughNodeFloat.KernelPorts.Input);
    8.             ctx.ForwardInput(KernelPorts.YParam, m_YParamNode, KernelPassThroughNodeFloat.KernelPorts.Input);
    9.             ctx.ForwardOutput(KernelPorts.Output, m_NMixerNode, BlendTreeWithStateMachineNMixerNode.KernelPorts.Output);
    I fixed it by just changing the Weight's float value to a float4 in order to accomidate more data.
    Code (CSharp):
    1.  
    2.             // Setup port forwarding
    3.             ctx.ForwardInput(KernelPorts.Time, m_TimeNode, KernelPassThroughNodeFloat.KernelPorts.Input);
    4.             ctx.ForwardInput(KernelPorts.DeltaTime, m_DeltaTimeNode, KernelPassThroughNodeFloat.KernelPorts.Input);
    5.             ctx.ForwardInput(KernelPorts.Weight, m_WeightNode, KernelPassThroughNodeFloat4.KernelPorts.Input);
    6.             ctx.ForwardOutput(KernelPorts.Output, m_NMixerNode, BlendTreeWithStateMachineNMixerNode.KernelPorts.Output);