Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / My FPS Controller is jumpy

Author
Message
AJ Schaeffer
16
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 14th Jul 2011 02:37
So I finally came back to DBpro amd whipped up a FPS Character controller. I've never actually made a character controller this successful on my own before so it probably isnt the best way of doing this but oh well.


If you run the code and turn a little and move its quite jumpy.
Any ideas?

I might actually make a FPS game!

Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 14th Jul 2011 03:11
It could be because you are mixing floats and integers. Your parameters for Poscam are x, y and z which are integers but you pass floats into them therefore losing accuracy. There are also a few other integers that need to be converted to floats. Try this:

Any better?

AJ Schaeffer
16
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 14th Jul 2011 03:31
Thanks

Qqite
16
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 18th Jul 2011 17:06

mousemovex() updates each call. So this split makes the values different.

Try calling once to a variable and then set both to the same value.

Ventures of the worlds around us are limited only by our imagination.

Login to post a reply

Server time is: 2026-07-10 10:20:51
Your offset time is: 2026-07-10 10:20:51