Search code examples
unityscriptunity-game-engineskybox

How to move the Camera in Unity Panorama Street view?


↪️ I want to embed a street view in app so I created a new Project


enter image description here


↪️ Added Street View To Skybox from the asset store


enter image description here

enter image description here

enter image description here


↪️ Imorted a street view from google maps to a Skybox


enter image description here

enter image description here


↪️ Drag and droped the sky box in the scene


enter image description here


↪️ how I do move the camera in response to the touch and mouse moment like a panorama in this example


↪️

1.Unit 3d documentation

2.Unity Touch Swipe Camera Rotation - Touch FPS Controller

3.Street View Convert

4.Street view converter unity 3D panorama

5.Unity3D Tutorial: How to make Skybox 360 single texture


Solution

  • I'd do the following:

    • Create an empty GameObject called "RotorY" which will be responsible for y rotation of your camera (looking around).
    • Create an empty GameObject "RotorX" as a child of "RotorY". This one will control x rotation (looking up and down)
    • Make camera a child of RotorX. (also make sure RotorX and Camera have (0,0,0) position in local space)
    • Add this script to any gameObject and assign rotorY and rotorX to the slots (while experimenting I ended up writing this script, lol)

    EDIT January, 2017: added 2 lines in the code to make it work with unity 5.5