Skip to main content
GameDev.net gamedev.net
🔒 Locked

tutorial 10....walk bias please help

Started by AGD011 Jul 7, 2003 at 5:24 PM 2 replies 1.2k views
Original Post
AGD011
AGD011
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);
AGD011
AGD011
any help and direction is greatly appreciated!
Sander
Sander
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]
AGD011
AGD011
awesome thank you!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.