Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

I want to know if one game object and talk to an nother game object

Discussion in 'Getting Started' started by sadsack, Dec 9, 2019.

  1. sadsack

    sadsack

    Joined:
    May 27, 2015
    Posts:
    156
    I got this crazy game object that is running all over the map. He never stop. What I would like to know be for I put to much time into this crazy game, is can one object send info to an other?
    Like X and Y location of something in the map (House.tank girl and any other thing he may come across.)
    If so can any one know of a tut that will show me ho to do it.
    Thank You
    Renny
     
  2. Bill_Martini

    Bill_Martini

    Joined:
    Apr 19, 2016
    Posts:
    445
    This is pretty basic stuff you're asking. I think you should spend some time in the Learning section to get a better understanding.

    As long as you have a reference to a gameobject you can get it's transform (position, rotation, scale), or any other component on that object including scripts. It's unclear exactly what you are trying to do, so that's all the help I can give. I can't believe that with a little refresher in the tuts, you couldn't figure this out yourself. Examples of this are in quite a few them, maybe hiding in plain sight.
     
  3. sadsack

    sadsack

    Joined:
    May 27, 2015
    Posts:
    156
    Simple I want one object to tell another object what to do
     
  4. Bill_Martini

    Bill_Martini

    Joined:
    Apr 19, 2016
    Posts:
    445
    I'll say again...

    As long as you have a reference to a gameobject you can get it's transform (position, rotation, scale), or any other component on that object including scripts.

    And of course set it too.
     
  5. sadsack

    sadsack

    Joined:
    May 27, 2015
    Posts:
    156
    Thanks
     
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,754
    Look into tutorials, these will give you some ideas.