8 – Finetuning Wall Jump

My first iteration of the Wall Jumping was barebones and just got the mechanics working, but not the way I wanted them to be.

A major issue was that if the player kept moving against the wall and jump they immediately go back onto the wall and essentially ‘climb’ their way up similar to a slinky (back-and-forth).

Thise brings up lots of exploits and allows the user to essentially climb and scale up walls really quickly – while a neat feature it goes against what I originally intended.

 
Picture

 
In order to fix it I looked for a way to essentially eiter ‘disable’ controls to prevent the player from holding the move button right back into the wall after jumping or a way to affect the player’s drag to stop them from returning to the wall as quick.

Eventually I settled on the first option as changing the player’s drag affected the directional force applied to the object.

I looked at various ways to disable controls but those suggested disabling a PlayerController script that I didn’t have (for now), but one person suggested creating booleans and use conditions to do it instead so I did just that.

I also played around with modifying movement speed through air via (airSpeed) variable to prevent the player from ‘climbing’ but that went against the whole focus on minimum input lag I was talking about on Post 7.

Picture

 
In order to modify the boolean above I needed to add a delay/wait timer in the playerSpikes script, unfortunately Unity doesn’t have a simple delay function so I found a way suggested to do it via Coroutines. After fiddling about and referring to platformers such as Super Meat Boy I found a good balance on when the player should regain controls.

A good balance for me meant that the player can’t significantly climb high like in the old version (seen in video below) but can also regain control quick enough to add momentum and boost jump to reach further obstacles (also seen in video below)

 

Video

Leave a Reply

Your email address will not be published. Required fields are marked *

I accept that my given data and my IP address is sent to a server in the USA only for the purpose of spam prevention through the Akismet program.More information on Akismet and GDPR.