Unity - pack_player.isPlyaing ?

Discuss issues pertaining to the various game/web runtimes of Creature here.
Post Reply
Fruhti
Posts: 2
Joined: Sat Oct 19, 2019 3:24 pm

Unity - pack_player.isPlyaing ?

Post by Fruhti » Sat Oct 19, 2019 3:37 pm

Hi,

Im having trouble getting animation playback info.
I would like to know when my animation has stopped playing. Using the "pack_player.isPlyaing" I always get a return value True (whether the animation is playing, or if it has stopped). Bellow is my simple code. In the Creature Pack Renderer I have "Sholud_Loop" - Off, and "Should_play" - ON.
Any ideas what im missing?
Thank you

Code: Select all

public class SplashScreen : MonoBehaviour
{

    public bool started = false;    

    CreaturePackRenderer creature_renderer;   

    // Start is called before the first frame update
    void Start()
    {
        creature_renderer = GetComponentInChildren<CreaturePackRenderer>();
    }

    // Update is called once per frame
    void Update()
    {
        if (creature_renderer.pack_player.isPlaying == true)
        {
            Debug.Log(creature_renderer.pack_player.isPlaying);
        }
        if (creature_renderer.pack_player.isPlaying == false)
        {
            Debug.Log(creature_renderer.pack_player.isPlaying);
        }
    }

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: Unity - pack_player.isPlyaing ?

Post by chong » Sat Oct 19, 2019 10:51 pm

Hello,

isPlaying is just used to make sure the targetAnimation is updated, it's not useful in your current case.
If you want to detect your case, I suggest you can go into CreaturePackModule.cs: correctTime()

Notice how it detects for the 2 cases ( looped and non loop ). You can then add/trigger your own custom event to notify it has stopped playing from there if you want.

Thanks

Fruhti
Posts: 2
Joined: Sat Oct 19, 2019 3:24 pm

Re: Unity - pack_player.isPlyaing ?

Post by Fruhti » Sun Oct 20, 2019 9:33 am

Hi,
works like a charm, thank you for the fast replay. Keep on the good work :)

Post Reply