Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


tutorial 10....walk bias please help

This topic is 5466 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all. the walkbias works if y=0....but say if I jumped up a level and now y=10....the walkbias still acts as if y=0. how do I get the walkbias to work no matter what my base Y equals. here''s the code: if (walkbiasangle >= 359.0f) { walkbiasangle = 0.0f; } else { walkbiasangle+= 10; } walkbias = (float)sin(walkbiasangle * piover180)/20.0f; ypos = -walkbias-0.15; UpdatePosition(-xpos,-ypos,-zpos);

Share this post

Link to post
Share on other sites
Easy, Create a new variable that will hold your final ypos. like:

float biasedYpos;

then, change the last line to:

biasedYpos= ypos - walkbias-0.15f;

and make sure you translate the camera using the biasedYpos and not the regular ypos.

Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]

GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don't post crap!

[edited by - sander on July 8, 2003 10:09:23 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!