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

GameObject.Find() documentation issue

Discussion in 'Editor & General Support' started by Clonkex, Apr 26, 2014.

  1. Clonkex

    Clonkex

    Joined:
    Jul 31, 2012
    Posts:
    31
    Hi all,

    I've been trying to work out why GameObject.Find() doesn't seem to give a consistent result, and opened the docs to read more carefully about how it works. The examples have a bit that says "MonsterArmHand", with "Arm" written as smaller font. I wonder whether it's meant to be "Monster_Arm_Hand" or something. Is this actually an issue with the docs or does Unity somehow decide from the capitalisation which is parent and which is child?

    I have another question also. Does the command require the forward slash ("/") at the start of the string or does it only have to exist somewhere inside the string? And if I do use a "/" at the start of the string, what does that mean? Does that mean the "filename" as it were is starting from the top of the hierarchy?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    It's meant to be Monster/Arm/Hand (also /Monster/Arm/Hand in the other example).

    --Eric