Search Unity

Rotate.Around() doesn't work with terrain?

Discussion in 'Editor & General Support' started by nikemerlino, Dec 27, 2011.

  1. nikemerlino

    nikemerlino

    Joined:
    Jul 2, 2008
    Posts:
    66
    I have placed a camera to 0,0,0.
    It has a simple script attached : Update
    scene.transform.RotateAround ( camPosition,Vector3.up, 10.0F * Time.deltaTime)

    If scene is a mesh like the built-in plane and if I move the camera in runtime the mesh rotate properly around the new position of the cam, but if scene is a Terrain the terrain rotate in different mode not around the camera. What is wrong?

    My problem is to create a scene with a fixed camera translating and rotating the scene around the camera.
    With a mesh it works fine and I can do all the translations and rotations, with a terrain I can do only translation.
    Thanks
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Terrains can't be rotated.

    --Eric
     
  3. nikemerlino

    nikemerlino

    Joined:
    Jul 2, 2008
    Posts:
    66
    Thanks Eric, I don't find a good solution to solve my problem. I could use a mesh to represent the terrain but I love the terrain module of unity... Why the terrain can't rotate, what is the reason and what is the impediment.
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The terrain isn't a mesh, it's generated dynamically at runtime, and not allowing rotation allows various optimizations, both with the generated terrain and the terrain collider.

    --Eric
     
  5. nikemerlino

    nikemerlino

    Joined:
    Jul 2, 2008
    Posts:
    66
    Thanks, you are precious !