Jump to content

[SOLVED] Why there isn't a method to play the animations of skinned mesh reverse?


photo

Recommended Posts

Posted

Hi, 

I see the ObjectMeshSkinned class has a "Play()" method to play the animations of skinned mesh. 

Why there isn't a method to play animations reverse? Like "PlayReverse()" for example.

Posted
15 hours ago, silent said:

songtao.han

Can you show us your code? It looks like we can't reproduce this.

It's a component.

Here's playing the animation :

using System;
using System.Collections;
using System.Collections.Generic;
using Unigine;

[Component(PropertyGuid = "2b2f38e9cd42ad3423e877034df33086d433ce2d")]
public class AnimTest : Component
{
    private ObjectMeshSkinned Landgear;
    private void Init()
    {
        // write here code to be called on component initialization
        Landgear = node.GetChild(node.FindChild("Landgear")) as ObjectMeshSkinned;
    }

    private void Update()
    {
        // write here code to be called before updating each render frame

        if (Landgear != null)
        {
          if(!Landgear.IsPlaying)
            Landgear.Play();
        }
    }
}

And here's trying to play the animation reverse like the dude said upside but not working :

using System;
using System.Collections;
using System.Collections.Generic;
using Unigine;

[Component(PropertyGuid = "2b2f38e9cd42ad3423e877034df33086d433ce2d")]
public class AnimTest : Component
{
    private ObjectMeshSkinned Landgear;
    private void Init()
    {
        // write here code to be called on component initialization
        Landgear = node.GetChild(node.FindChild("Landgear")) as ObjectMeshSkinned;
        Landgear.Speed = -1.0f;
    }

    private void Update()
    {
        // write here code to be called before updating each render frame

        if (Landgear != null)
        {
          if(!Landgear.IsPlaying)
            Landgear.Play();
        }
    }
}

 

Posted
2 hours ago, silent said:

More likely you need to increase the framerate of your animation to be more or less 30 fps:


Landgear.Speed = -30.0f;

 

It is working now. Thanks!

But you guys really don't think about adding a play reverse method?

  • silent changed the title to [SOLVED] Why there isn't a method to play the animations of skinned mesh reverse?
×
×
  • Create New...