playMaker

Author Topic: map movement and cam rotation is slower depending on frame rate?  (Read 878 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Hello. I have two issues. one with moving the map in the map view, and one with rotating the camera around the player in normal gameplay. they work fine. BUT, these things are slooow in play mode, and super fast in builds. i am wondering if the float operators used need to use delta time instead of "every frame" or something?

in the map view, you press the left stick, and the camera moves in front of the textured map plane. here's how it's set up:
get axis vector of the Left Gamepad Stick.
get the current camera position's x and y floats.
do a float operator to add the input axis vector to the position floats.
set the new camera position.
all are set to 'every frame.'
it works normally except for the speed changing wildly. in builds the camera moves around the map quickly, but in play mode it moves slowly. i am worried the default map move speed will be different for players depending on their computer's specs. i seem to remember something about using 'delta time' to ensure the view changes in a speed independent of frame rate, but I'm not sure how that would apply here. in play mode, everything else works normally, but at a lower frame rate than builds, but there's no noticeable input differences except for these.


The second problem is the same, except it's with regard to using the gamepad stick to rotate the camera centered around the player model. in play mode, it rotates slowly, and in builds, it rotates wildly fast.

for camera rotation around the player, it's this:
get axis vector of right stick.
vectory3 add xyz, to add the axis input to the current camera rotation.
wait till next frame, repeat.

in both of these cases I can change the input axis multiplier floats to "fix" this, but this makes it hard to figure out what the default speeds should be since it varies.

what can I do to make these changes to position and rotation, happen at a speed independent of player's computer speeds (and to not need two different multiplier float settings to toggle depending on if I'm testing in play mode or in a build)?

for all I know for a player with a fast computer the camera might rotate so fast the game is unplayable, and for all I know on someone's computer that's slow, it might rotate so slow it's unplayable, so I am worried about this.