Forum rules - please read before posting.

Camera Drag behave different on multiple devices

edited November 2021 in Technical Q&A

Hi Chris
I'm using Camera 2D Drag to pan in a 2D game. It was Ideal to drag exactly with mouse or touch position but now it moves faster of slower than the input because of acceleration and deceleration effects. I can manage to find a better combination of speed, acceleration and deceleration
but the real problem is that if I build the game it behaves completely different in multiple devices. all are PCs (windows) with slightly difference in resolutions. in editor even in different devices it is fine but not in builds. camera 2d drag settings are the same but in some devices the speed is crazy fast and it jumps with a minor move of mouse while in some it's very slow. the input method is mouse and keyboard.

Comments

  • I'll attempt a recreation. Can you share screens of the camera's Inspector, your AC/Unity versions, and details of some of the resolutions involved?

  • Recreated - this appears to be an issue related to the machine's framerate.

    To address it, open up GameCamera2DDrag.cs, and replace the line:

    return KickStarter.playerInput.GetDragVector ();
    

    with:

    return KickStarter.playerInput.GetDragVector () * Time.deltaTime * 50f;
    
  • edited December 2021

    exactly it is related to devices different frame-rates, inputMovement is being used after multiplying to deltaTime later to determine deltaXY but I missed its role in the scaleFactor. thanks a lot. :blush:
    you responded on time and I get it right away but forgot to thank you at the same day. ;)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.