Hi,

My goal is to set opening animation for my player. So, I made a schematic like this:

image

And it works perfectly, but I can still move my player alongside with playing animation. I'm using "Button" player controls:

image

Basically, I want to block player controls at the time animation is playing. Is there another way to do that or I did something wrong?

Regards,
Sylwester
  • My initial thought is that the Mecanim Animation node doesn't have Wait checked (so it continues with the schematic immediately) and/or the animation clip name in ORK is not defined correctly, so it's returning "0" seconds as a wait time, and immediately continuing on and then unblocking. To fix this you just need to be sure it's set to Animation Clip and the name matches the actual .anim / .fbx animation name.

    You should be able to put a console node before + after the animation node to verify this, but if so then you'd need to just be sure the Mecanim definition matches the actual clip name to get accurate wait durations back.

    There's a quick start thread I did for Mecanim (second post goes over an example of playing a Talk animation and blocking player control until its done), and here's a screenshot from that illustrating what I'm trying to say above with animation names:

    image
  • Thanks for reply.

    Unfortunately, it still doesn't work. Animation Clip and the name matches actual .anim animation name. I checked "Wait" option in Mecanim Animation node and I still can move the player while animation is playing.

    Maybe it's because I have "Use Auto Animation" checked?
    image

    In Animator panel I have "Idle" as a default state. I just want to start with "Sleeping" animation, then stand up and go to idle.
    image

    For now, he is sleeping, but when I hit "W" to go forward, my character suddenly goes to "Walk" animation.

    I set this animation in ORK like this:
    image
  • I don't think auto animation matters because the controller should be disabled when blocked which would prevent it from kicking in since nothing should be moving.

    You can try just adding a regular Wait node after the animation and before the unblock for however long you want it to wait. If you can move during this wait (like if you set it super long like 5 seconds) then the issue is in the blocks / character controller.

    Another possibility is that your animation is very short ( just a few frames ) in which case the reported wait time will also be short since it'll be "done". Setting the animation to loop or using the hard defined wait as above should handle this.

    If you plan on calling standing and then idle after this animation though, I think the hard defined wait node is probably your best bet anyways since you can control the exact times before starting the next animation.
  • @Acissathar - yes, thanks to you I finally figured that out :)

    So now it looks like this:
    image

    Works like a charm :) Thank you very much for help!
  • No problem!
Sign In or Register to comment.