• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows (Solved) Trying to make a "grapple" move

P

Potoroo84

Guest
I'm trying to implement a "grapple" move.
If the opponent is in front of the player, a timeline plays, and the opponent is thrown to the other side. If he's not, it will cancel the move.

The problem is that i'm checking if the opponent is in front. So when the timeline starts, he's not in front anymore and the move is canceled before the timeline finishes.

Does anybody know a better way to approach this?
 

Flaick

Member
Can you post some code?

Anyway for an implementation like that, i generally prefer alarms rather than timelines.
 

NightFrost

Member
If the opponent is in front of the player, a timeline plays
So when the timeline starts, he's not in front anymore
You're providing some conflicting information. You say timeline starts when opponent is in front of player, but also say when timeline starts, they are no longer there. Which one is the case? You're not allowing the opponent to act, are you? Since the grapple timeline is now in control of their actions, the opponent itself should just sit still.
 
P

Potoroo84

Guest
Sorry, i found a solution, which was to make the player "freeze" at the start of the timeline and un-freeze the player when it finishes.

The condition for the timeline to start is that the opponent is in front of the player. At the end of the timeline, the opponent is moved behind the player.

So to check if the grapple missed, i checked if the opponent wasn't in front of the player AND if the player wasn't frozen.
Now, when the grapple is successful, the player is frozen, so even if the opponent isn't in front, it doesn't cancel the move until its finished.
 
Top