Jump to content

How could I emulate/create a bunnyhop character controller?


casool
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...