Vector3 moveTo = new Vector3(deltaPosition.x, deltaPosition.y, 0) If (convertToViewportPoint) deltaPosition = mainCam.ScreenToViewportPoint(deltaPosition) Public void Move(Vector2 deltaPosition, bool convertToViewportPoint = true) My CameraController class is as follows: public class CameraController : MonoBehaviour Public void MiddleButton_started(InputAction.CallbackContext ctx) Private InputAction.CallbackContext context Private InputControls inputControls // InputControls is just the auto-generated class when you set up a new Input Action asset public class InputController : MonoBehaviour Essentially, from what I can see, the movement speeds of the camera and the mouse are not the same ( see visual). However, there is a parallax-y feel to the movement that I am trying to avoid. So, I am working with Unity's new input system and I have been able to set up movement on the camera so that the user drags the camera around with the middle mouse button.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |