Topic: Move camera to center of map

I had to upgrade to Unity 2018 from 5.6 as well as your online maps version (3.0.4.1).

So I've worked out all the kinks except one...

In my app I loaded a tileset prefab and allowed camera control = true (in code) which would position the camera over the center of the map.  Used the adjust to screen size utility script.

Now when my prefab loads, the camera is not moving into position at the center of the map.  When testing in the Editor, I can click the "Move camera to center of Map" button, which works perfectly.  However if I copy that bit of code from online maps into my "Init" code, it doesn't work.

What am I doing wrong?  I don't want the user to be able to rotate the map, only position and zoom.

Thanks.

Re: Move camera to center of map

Hello.

In Online Maps v3, this feature is moved into a separate component - Online Maps Camera Orbit.
Just add this component to the map.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Move camera to center of map

Thanks this works, but I only want the camera to be positioned in the center of the map (which it now is).  I don't want to allow the user to rotate the map.  I see the lock tilt and lock pan, I set rotation to 0, but user can still rotate.  Is there a way to lock rotation, or should I just disable the camera orbit after it move the camera into position?

Thanks

Re: Move camera to center of map

Just checked lock pan and lock tilt and it works correctly.
In addition, you can set the speed - (0; 0).

Theoretically, this might not work if you have two instances of the Camera Orbit in the scene.
Please make sure that you have only one instance of this script in the scene.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.