Jump to content

How could I emulate/create a bunnyhop character controller?


Recommended Posts

Posted

I want to have Bunnyhopping in my game, but I have no idea where to start doing this character controller

 

 

If you don't know what Bunnyhopping is, it basically involves the player jumping instead of running to move around, and using the A and D keys (moving their mouse left and right with each press, A = mouse swipe left, D = mouse swipe right) This is called strafing or 'weaving' sometimes

 

The w (forward) key is never pressed except to start the bunnyhopping

 

Here's a video of this mechanic demonstrated in Counter Strike Source

 

 

Bunnyhopping has actually been a part of many games including Quake and Half Life

 

Could anyone take some time and explain/help? Thanks

Posted

It is not that hard actually, but it probably requires a lot of finetuning.

I set the jump height to 14 and speed to 10. Level 2 from the tutorial set is actually a great test level.

 

I used the FPSplayer for this. I simply removed the forward and backward movement. Jumping happens every physics update as long as we are not airborne and the player has started bunnyhopping. In the update function I check for the W key to be pressed, which activates the jumping.

 

FPSHopper.lua

 

http://www.youtube.com/watch?v=zxpoiQnRfPY

Posted

Wow that looks nice, but is there any setting for Air Acceleration to get a proper weaving movement? I see in your video that turning mid air requires sharp turns

Posted

as suggested, this requires fine tuning on your end. In the physics update you can check if you are being airborne. During airborne you can increment the speed which is applied at the z axis. When you hit the ground again, the speed should be reset back to its default value.

Posted

Ah ok, also as an added note, when I was talking about W, I meant it just acts normally (move forward) and is just used to gain the starting momentum, jumping is still done with space (hold for autohop) or mousewheel scroll (manual hop)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...