How do I stop my character from landing and sliding?

Get help using Construct 2

Post » Mon Feb 16, 2015 3:07 am

Any thoughts on how to fix the landing and sliding?

I made a video showing the character animation so far and the problem.
http://youtu.be/lpeutR0LuDg 

Also-- thanks in advance :)
You do not have the required permissions to view the files attached to this post.
B
15
S
5
G
2
Posts: 164
Reputation: 3,080

Post » Mon Feb 16, 2015 3:19 am

I use a variable as a simple "state machine" when controlling a character. I call the variable "stuckin-in-move" and set it to 1 whenever the player should not be able to control the character.

For example:
on land>set stuck-in-move to 1+play animation landed

on animation "land" > set stuck-in-move to 0+set animation to idle

Then all the controls that move the character or change its animation have a condition: does stuck-in-move=0

If not, it wont let the players controls move the character or change his animations.

On top of this, you could do: animation "land" is playing> set vectorY to 0

cheers,
Mike Parent
B
47
S
9
G
4
Posts: 421
Reputation: 6,939

Post » Tue Feb 17, 2015 1:57 am

Protip: Print screen button is your friend :)
B
18
S
6
G
4
Posts: 221
Reputation: 3,275

Post » Tue Feb 17, 2015 1:54 pm

@Brashmonkey, I tired--
on land>set stuck-in-move to 1+play animation landed

on animation "land" > set stuck-in-move to 0+set animation to idle

Then all the controls that move the character or change its animation have a condition: does stuck-in-move=0

But my "stand-up" idle animation pops up (I'm okay with that); however, sliding still happened :/.


I added "On top of this, you could do: animation "land" is playing> set vectorY to 0" but then the character kept re-spawning at 0 and was stuck in a loop.

@Hasuak like my screen shots? Can you recommend a good desktop recording program?
You do not have the required permissions to view the files attached to this post.
B
15
S
5
G
2
Posts: 164
Reputation: 3,080

Post » Tue Feb 17, 2015 2:03 pm

The problem seems to be when I have my finger on the left or right arrow key, it causes the character to slide after the land. Working on it again now.
B
15
S
5
G
2
Posts: 164
Reputation: 3,080

Post » Sat Feb 21, 2015 10:26 am

My bad. I accidentally left out a critical word in my initial suggestion:

It should be: Animation "land" has FINISHED, set stuck in move to 0.

Also, all events that change the animation should check to see if "stuck in move" = 0.

Also, you could disable the platform movement behavior while the player is playing the land animation.

I suggest you post your actual capx so someone can help more easily, you say you'e still working on it so you could have a whole new set of different problems in your events by the time someone tried to help you.

If you don't want to post it, you could email it to [email protected] and I'll help you resolve the issues.

cheers,
Mike
B
47
S
9
G
4
Posts: 421
Reputation: 6,939


Return to How do I....?

Who is online

Users browsing this forum: Marcos12, nanogod and 7 guests