Topic: Camera snaps back to previous position when moved

Hi! I needed to add a system where the user can press the Tab key in order to move the camera to focus on each hotspot. Unfortunately, when I then try to use uPano's keyboard or mouse controls, the view snaps back to the last camera pan/tilt position as remembered by those controls. Is there any way to get the controls to use the camera's current position instead of a cached position if I need to temporarily take manual control of the camera for this system?

Re: Camera snaps back to previous position when moved

Hello.

By default, you cannot control the camera directly, because when something changes pan / tilt, uPano will set its camera rotation.
Instead, you need to set a new pan / tilt (Pano.LookAt).
https://infinity-code.com/doxygen/upano … a9169eae37

How to find out the pan / tilt you should set:
If pan / tilt is known for an object (for example, this is HotSpot), then you can get the value from it (HotSpot.pan, HotSpot.tilt).
https://infinity-code.com/doxygen/upano … 8f3f5551f1
If pan / tilt for the object is unknown, then you need to convert the screen position (PanoRenderer<T>.GetPanTiltByScreenPosition) of an object, world position (PanoRenderer<T>.GetPanTiltByWorldPosition) of an object or UV of a panorama texture (SingleTexturePanoRenderer <T> .GetPanTiltByUV) to pan / tilt.
https://infinity-code.com/doxygen/upano … 85d77456d1
https://infinity-code.com/doxygen/upano … fd68373b4f

Kind Regards,
Infinity Code Team.

uContext is Editor PowerPack (more than 40 tools) that take your workflow in Unity Editor to a next level, simplifies working with content, adds new features, corrects and improves the editor’s built-in behaviors. Click here to download uContext Basic for free.

Re: Camera snaps back to previous position when moved

Thanks! That took care of the problem.