Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How do I rotate terrain from a script?

Discussion in 'Scripting' started by Khaoscraft, Sep 30, 2020.

  1. Khaoscraft

    Khaoscraft

    Joined:
    Jul 23, 2020
    Posts:
    10
    Hello! So in my game, I need to be able to rotate terrain pieces based on the player input, but unfortunately terrain is not affected by the normal transform properties. What do I need to add to my script in order to make it actually rotate the terrain?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,760
    Pretty sure Unity
    Terrain
    does not pay attention to the .
    rotation
    or
    .localScale
    fields of the
    Transform
    component on its
    GameObject
    .

    I speculate this is done for efficiency but I was not involved in any way.
     
  3. Syco753

    Syco753

    Joined:
    Feb 11, 2013
    Posts:
    42
    I just tested it and it doesn't work as you said. Even when the terrain is not marked as static.
    The only solution that I have is to rotate everything arround the terrain
     
  4. Khaoscraft

    Khaoscraft

    Joined:
    Jul 23, 2020
    Posts:
    10
    Well the only reason I wanted to rotate terrain specifically was because of grass. I could make slightly worse looking grass that is not a part of terrain and it would work