I am doing a 2d game, I need the player to grab a rope and climb until he reach a node so he can access a drawer ( there is also a enemy around) but I don't know how to free the player after that.
https://imgur.com/a/2Lg6Lt7
Also how do I stop her from going up outside the rope?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
If you're only allowing the Player to move vertically, you don't need to rely on a Path constraint - you can use the Player: Constrain Action to limit their movement to just Up and Down directions, while locking Left and Right.
You can use a Trigger2D to unlock their constraints once they reach the top again with the same Action type.
To have this only affect the Player while they are on the ladder, attach a Remember Trigger component to the Trigger and set its default state to Off. Then use the Object: Send message Action to turn it on when they begin climbing the ladder, and use the same Action to turn it off as part of the Trigger's "On Enter" Actions.
I did what you told but I think I did wrong. I also didn't explain very well.
Is not a ladder but 3 separated ropes, the player doesn't have to go all the way up cs there is no place to 'land' up there, he has to climb up and climb down managing the enemy and opening the drawers.
I wish that when he get close to the ground he could press 'F' and let go the rope.
https://imgur.com/a/wioTgdh
If the Player can move and get off freely, you'll first want to place down colliders to prevent him from going too far.
Add a pair of "Collision Cube 2D" prefabs from the Scene Manager, and add them to the top and bottom of a rope. If the Player has Rididbody2D / Collider2D component, these will block their movement. You can use the Object: Send message Action on these collision objects to turn them off/on if you need to limit their effect to only when the Player is climbing a rope.
To have the Player be able to get off when pressing 'F': what is your Settings Manager's Hotspot detection method set to? If its Player Vicinity, and your Player character is set up with a Detect Hotspots component to detect nearby Hotspots, then you can place down a Hotspot at each "exit point" on the rope, that - when interacted with - has them leave it and positions them at the right place.
You'll need to be more specific about which sprite is unwanted, as well as provide a clearer screenshot.