Buggy animations - quick enter and exit from trigger
Quote from Konke on June 3, 2018, 5:17 amHello! I'm trying to get a couple of robot arms to animate open and close. They should pop out of the floor when the player gets into a trigger_multiple. I've set it so the arm uses the open animation when the trigger is set to OnStartTouch and when the player exits the trigger lets the arm close via OnEndTouch.
No to the issue: when the player get in and out of the trigger quickly the animation starts to bug. It feels choppy and the arm might even get stuck in the open animation's idle state when the player has left the trigger. Is there a way to get the animations run properly and smooth? Thanks in advance!
Hello! I'm trying to get a couple of robot arms to animate open and close. They should pop out of the floor when the player gets into a trigger_multiple. I've set it so the arm uses the open animation when the trigger is set to OnStartTouch and when the player exits the trigger lets the arm close via OnEndTouch.
No to the issue: when the player get in and out of the trigger quickly the animation starts to bug. It feels choppy and the arm might even get stuck in the open animation's idle state when the player has left the trigger. Is there a way to get the animations run properly and smooth? Thanks in advance!
Quote from Kwinten on June 4, 2018, 5:46 pmFirst, make sure that you've set the "Hold animation" to "Yes" and default animation to BindPose (sometimes it can be different, check in model tab what is the default animation used by the model)
-> That will avoid to your model to be stuck in-animFor the trigger thing, if the solution above isn't enough for the arms to work properly, i would suggest to play with delays
(add 2 transition logic_relay and use the "cancel pending" option of it at your own advantage)
First, make sure that you've set the "Hold animation" to "Yes" and default animation to BindPose (sometimes it can be different, check in model tab what is the default animation used by the model)
-> That will avoid to your model to be stuck in-anim
For the trigger thing, if the solution above isn't enough for the arms to work properly, i would suggest to play with delays
(add 2 transition logic_relay and use the "cancel pending" option of it at your own advantage)
Quote from Konke on June 8, 2018, 1:12 pmKwinten06 wrote:First, make sure that you've set the "Hold animation" to "Yes" and default animation to BindPose (sometimes it can be different, check in model tab what is the default animation used by the model)
-> That will avoid to your model to be stuck in-animFor the trigger thing, if the solution above isn't enough for the arms to work properly, i would suggest to play with delays
(add 2 transition logic_relay and use the "cancel pending" option of it at your own advantage)Sorry for the late reply. I'd be interested in trying out the 2 transition logic relays. How do they work and how do I set them up? Don't think I have any experience with them.
-> That will avoid to your model to be stuck in-anim
For the trigger thing, if the solution above isn't enough for the arms to work properly, i would suggest to play with delays
(add 2 transition logic_relay and use the "cancel pending" option of it at your own advantage)
Sorry for the late reply. I'd be interested in trying out the 2 transition logic relays. How do they work and how do I set them up? Don't think I have any experience with them.
Quote from DaMaGepy on June 18, 2018, 2:21 pmWith any animation where there is a chance to reverse the animation before it completes (when leaving then it "jumps" and starts from the fully opened anim, looks bad and buggy), the solution is to set the closed "animation" (idle) as bindpose, set set hold animation ON, and then in trigger:
OnStartTouch: armname SetPlaybackRate 1
OnEndTouch: armname SetPlaybackRate -1and with a trigger auto (starts once with map):
OnMapSpawn: armname SetAnimation whatever_opening_anim_name 0.01
OnMapSpawn: armname SetPlaybackRate -1 0.02- the first sets the opening anim
- the second makes sure that it stays in the starting positionBasicall there is only the opening anim, it plays with speed 1 when activated (SetPlaybackRate 2 is 2x faster, 0.5 is 2x slower)
When you leave the trigger halfway of the animation, it just reverses the animation with the negative speed, wherever the anim is, it just reverses, no jumping or blinking, if its 70% played then plays back from there if just started then will juts move back. Looks smooth, can be activated without prob. If someone enters/leaves superfast then you can make 2 relay, 1 for opening 1 for closing and then just call the opening relay from the trigger while also canceling the other trigger's pending (cancelpending), and same for the closing relay but should not be a problem whithout this.Good for opening staircases where for exmple a button activates them. It makes the anim smooth. I used it in my map #4 (cube training) room 6 or for example no money for chambers 2 last laserrelay grid (a math counter sets speed plus and minus), you can download the vmf source of those maps from the workshop description, my map #4 used relays to activate the stairs but in nomoney2 justcalling one single prop directly on and off (playbackanim) was enough.
With any animation where there is a chance to reverse the animation before it completes (when leaving then it "jumps" and starts from the fully opened anim, looks bad and buggy), the solution is to set the closed "animation" (idle) as bindpose, set set hold animation ON, and then in trigger:
OnStartTouch: armname SetPlaybackRate 1
OnEndTouch: armname SetPlaybackRate -1
and with a trigger auto (starts once with map):
OnMapSpawn: armname SetAnimation whatever_opening_anim_name 0.01
OnMapSpawn: armname SetPlaybackRate -1 0.02
- the first sets the opening anim
- the second makes sure that it stays in the starting position
Basicall there is only the opening anim, it plays with speed 1 when activated (SetPlaybackRate 2 is 2x faster, 0.5 is 2x slower)
When you leave the trigger halfway of the animation, it just reverses the animation with the negative speed, wherever the anim is, it just reverses, no jumping or blinking, if its 70% played then plays back from there if just started then will juts move back. Looks smooth, can be activated without prob. If someone enters/leaves superfast then you can make 2 relay, 1 for opening 1 for closing and then just call the opening relay from the trigger while also canceling the other trigger's pending (cancelpending), and same for the closing relay but should not be a problem whithout this.
Good for opening staircases where for exmple a button activates them. It makes the anim smooth. I used it in my map #4 (cube training) room 6 or for example no money for chambers 2 last laserrelay grid (a math counter sets speed plus and minus), you can download the vmf source of those maps from the workshop description, my map #4 used relays to activate the stairs but in nomoney2 justcalling one single prop directly on and off (playbackanim) was enough.
Quote from Konke on June 24, 2018, 9:20 amThanks a bunch! I sure worked with DaMaGepy's suggestion and I seem to be good without the CancelPending command. When is it recommended to add that command?
The only negative thing I can come up with, working with SetPlaybackRate, is that it won't play a close animation if it is different than just playing the open animation backwards. Haven't checked the animations too closely if the animations mostly are this way or not. Perhaps someone knows more.
In any case, so far so good.
Thanks a bunch! I sure worked with DaMaGepy's suggestion and I seem to be good without the CancelPending command. When is it recommended to add that command?
The only negative thing I can come up with, working with SetPlaybackRate, is that it won't play a close animation if it is different than just playing the open animation backwards. Haven't checked the animations too closely if the animations mostly are this way or not. Perhaps someone knows more.
In any case, so far so good.