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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Access Object Size Values

Discussion in 'World Building' started by EricArmitage, Mar 10, 2021.

  1. EricArmitage

    EricArmitage

    Joined:
    Sep 17, 2019
    Posts:
    3
    When I create a probuilder game object the inspector displays the Pb_Object script size XYZ values. How do I access these values from another script attached to the same game object?

    void Update () {

    BuildingX = gameObject.GetComponent<pb_Object>().?????

    }
    upload_2021-3-10_10-25-5.png
     
    sonaht_unity likes this.
  2. NStone_

    NStone_

    Joined:
    Apr 12, 2021
    Posts:
    1
    gameObject.GetComponent<Renderer>().bounds.size