stop the crouch animation from looping(noob question)

Get help using Construct 3!

Post » Sat Aug 12, 2017 6:06 pm

Hello guys:

I'm setting the player inputs and the animation state to "crouch" but i don't know how can i make the animation to stop in the last frame and remain until I release the down button and it back to idle

this is my actual code:

+ Keyboard: ↓ is down
+ OR Keyboard: S is down
-> walking_mask: Set size to (106, 119)
-> obj_player: Set animator to "crouch"

I tried with this code:

+ Keyboard: ↓ is down
+ OR Keyboard: S is down
-> walking_mask: Set Platform maximum speed to 0
-> walking_mask: Set size to (106, 119)
-> obj_player: Set animator to "crouch"

----+ obj_player: Animation frame = 16
-----> obj_player: Stop animation

and this code:

+ Keyboard: ↓ is down
+ OR Keyboard: S is down
-> walking_mask: Set Platform maximum speed to 0
-> walking_mask: Set size to (106, 119)

----+ System: Trigger once
-----> obj_player: Set animator to "crouch"

--------+ obj_player: Animation frame = 16
---------> obj_player: Stop animation

but the crouch looping still looping :oops:
B
7
S
1
Posts: 20
Reputation: 413

Post » Sun Aug 13, 2017 8:24 am

Have you unchecked the "repeat" box in the objects crouch animation?
B
11
S
2
G
1
Posts: 44
Reputation: 730

Post » Sun Aug 13, 2017 8:40 am

mOOnpunk wrote:Have you unchecked the "repeat" box in the objects crouch animation?


Hello mOOnpunk I have recently found a solution:

// crouch
+ Keyboard: S is down
+ walking_mask: Platform is on floor
-> walking_mask: Set Platform maximum speed to 0
-> walking_mask: Set size to (106, 119)
-> obj_player: Set animator to "crouch"

----+ obj_player: Animation frame = 16
-----> obj_player: Set animation speed to 0


+ Keyboard: On S released
+ walking_mask: Platform is on floor
-> walking_mask: Set size to (213, 239)
-> walking_mask: Set Platform maximum speed to 1800

works fine! :mrgreen:
B
7
S
1
Posts: 20
Reputation: 413

Post » Mon Aug 14, 2017 11:58 am

I think you could save yourself a lot of code, if you just turned off the repeat checkbox in the animation properties of the animation editor of the crouching animation (phew, that's a lot of animation!) ;)
B
16
S
7
G
2
Posts: 111
Reputation: 2,149

Post » Tue Aug 15, 2017 5:19 pm

joelmayer wrote:I think you could save yourself a lot of code, if you just turned off the repeat checkbox in the animation properties of the animation editor of the crouching animation (phew, that's a lot of animation!) ;)


Hello joelmayer thanks for your reply:

¿you mean if the loop box is unchecked? yeah it was that's the weird thing :P
B
7
S
1
Posts: 20
Reputation: 413

Post » Thu Aug 17, 2017 2:25 am

maybe even adding a subevent for when down arrow is pressed, with an extra condition of trigger once while true, and having the event as, set animation to - crouch
then on released have it revert to w.e. animation
but theres no right or wrong way, if you managed to make it work, kudos.
B
22
S
12
G
1
Posts: 108
Reputation: 2,774


Return to How do I...?

Who is online

Users browsing this forum: No registered users and 1 guest