tutorial 10....walk bias please help

Started by
2 comments, last by AGD011 20 years, 9 months ago
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);
Advertisement
any help and direction is greatly appreciated!
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]

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

awesome thank you!!

This topic is closed to new replies.

Advertisement