I present this little enemy, I call it AyeAye, silly name, I know, but you can’t deny if fits, I also take this opportunity to show how my game is looking so far.
looking great ! love the bow and arrow
Looks great, I like the little details: dust/sand while jumping, and the animated wings while jumping.
how did you get the character to jump between the ladders?
I describe what I did below the line, but I’ll give you a far easier explanation on how to do this, because my method is a little complicated due to all the shenanigans I wanted for the ladders.
To make the character jump when in a ladder is fairly simple, you just have to add a condition that when touching a ladder the character can also jump, it’s really that simple.
My ladders do the following:
- If the character is climbing down and touches the ground it stops climbing.
- Can jump while in the ladders.
- When at the top of the ladders the character doesn’t start climbing until the down button in pressed.
- The character can walk at the top of the ladders.
- Unfortunately there’s a bug, that you cannot jump when moving up or down, there’s a way to solve this, but I didn’t want to implement it because it makes the game more difficult.
To achieve that I created a script that controls a climb state. The purpose of the script is to simply tell other scripts if the character is climbing or not, but as simple as it sounds, the script is a little long.
The ‘climber’ scripts depends on another script for it to work properly (which wasn’t intended), the script is called ‘Mover’.
If you read the ‘Mover’ script you’ll notice that it does nothing, that’s because the movement requires an input, which is handled by another script:
As you can see, the whole structure is a little complicated, but at that time I wasn’t able to find a fancier solution.
If you want to see how the ladders of my game work, you can play it here:
Look who is here, my friend doing great stuff !!
i miss you budy
hey, could i ask you how did you code that your character is not in Idlee mode when stopped on a ladder? ty
I don’t remember exactly how I did it, but I can assume I used a climbing state in the animator, so a basic bool would suffice, if the player is climbing then the climbing animation would play, if it isn’t, then play any other animation.
Something I noticed is that there’s no “idle climbing state”, that’s because there’s no need for that, there’s a script that controls the animation’s speed, if there’s no input then the animation speed is set to 0, this means the climbing animation would stop when the player stopped pressing any button, making it look as if there are several idle climbing animation states when in reality there’s none.
I hope this helps, if you need further explanation I recommend checking the repo, it is public. You can download the whole project and experiment with it if you’d like, that way you can see how I set up the animator and code to achieve that.