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

Question Check global/local position toggle via script

Discussion in 'Editor & General Support' started by victorluccas, Aug 18, 2023.

  1. victorluccas

    victorluccas

    Joined:
    Sep 11, 2019
    Posts:
    7
    Hello guys!

    As the title says, i want to know how to check via editor script which mode the Scene Window handles mode (Global or Local position/rotation/scale) is currently using.

    The reason i want this is because i want to create a custom tool that allows me to modify a Vector3 property while considering it a local position (related to the game object the script that has this property is attached to), but it would be nice if this can take as input a global position as well ( and converting it accordingly ), and it would be nice using this already existing setting as the one that decides which mode to use.
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,856
  3. victorluccas

    victorluccas

    Joined:
    Sep 11, 2019
    Posts:
    7