Search Unity

How to get object instance thru tag ?

Discussion in '2D' started by Orinuvan, Oct 20, 2020.

  1. Orinuvan

    Orinuvan

    Joined:
    Feb 3, 2019
    Posts:
    95
    Hi, I have this character and a ladder, I want to set the x pos of the player to the ladder so he is fixed there, but I dont have only one ladder, and so I would need to create gameobjects for each ladder and that is time costing, how can I check if a player is ovelapping the object with the "ladder" tag and then set the x pos of the player to the pos of the overlapped object?
     
  2. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,513
  3. Orinuvan

    Orinuvan

    Joined:
    Feb 3, 2019
    Posts:
    95