casool Posted February 6, 2014 Share Posted February 6, 2014 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 Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 6, 2014 Share Posted February 6, 2014 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 Quote Link to comment Share on other sites More sharing options...
casool Posted February 6, 2014 Author Share Posted February 6, 2014 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 Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 6, 2014 Share Posted February 6, 2014 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. Quote Link to comment Share on other sites More sharing options...
casool Posted February 6, 2014 Author Share Posted February 6, 2014 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) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.