|
Post by samanabo on Feb 27, 2020 19:28:14 GMT
I'm trying to move the camera to a new position without any transition or smoothing using MoveCameraInstantlyToPosition.
It seems that the Horizontal and Vertical Smoothing is always applied. How can I instantly change the camera's position with no transition? Perhaps I am misunderstanding the purpose of MoveCameraInstantlyToPosition. I have tested this with all extensions disabled, and the only setting that seems to affect it is the Horizontal and Vertical smoothing. Any help is much appreciated. I'm using ProCamera2D version 2.7.0 and Unity 2019.3.3f1
|
|
|
Post by samanabo on Feb 28, 2020 23:51:56 GMT
On further inspection this appears to be related to the Rooms extension. It appears as though moving the camera instantly into a room will trigger the rooms extension's room transition.to work around it I had to force the 'enter room' function, setting the transition to false.
Vector3 targetPos = ProCamera2D.Instance.TargetsMidPoint; ProCamera2DRooms proCameraRooms = ProCamera2D.Instance.GetComponent<ProCamera2DRooms>(); int startingRoom = proCameraRooms.ComputeCurrentRoom(targetPos); if(startingRoom != -1) proCameraRooms.EnterRoom(startingRoom, false);
|
|
|
Post by Luís Pedro Fonseca on Feb 29, 2020 11:36:43 GMT
samanabo That is correct. If you try to move to a position that is currently outside bounds (current room in this case), the camera will try to recover its correct in-bounds position. So, when you're using the Rooms extension, you should use the EnterRoom method like you did. Cheers!
|
|