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?
Another approach is to use physics. If the ladder has a Collider2D on it, you can use OverlapCircle
If the returned collider is a ladder (however you determine this… by tag, by component), then you can can then get the center point of the ladder to lock the player onto.
Thanks a lot I’ll try it ! <3