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


tutorial 10....walk bias please help

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