Overlap object detection is bugged or not working
-
I made sure both the player and the rope is present and named correctly
https://play.creaticode.com/projects/6750e68aa80eece3de43d381
-
@011830-0a42ef84 is non blocking collision turned on for both?
edit: I had looked over and is player the yellow box or is the avatar the player, if the avatar is the player object then that’s why
-
@tyller_ I’m not sure what you mean. How do I detect collision with the rope so it can actually climb it?
-
@011830-0a42ef84 is the player object (object with label player) the avatar or the yellow box, if it’s the avatar then the reason you can’t detect it is because both the rope and player have collision, so they collide with each other and can never overlap, overlap means they’re inside each other’s colliders, if the yellow box is labeled player then try turning on non blocking collision on that (and shrink it so the player can’t climb ropes from too far)
-
The 2 objects, “player” and “rope,” are not in the same sprite, so when you run this “overlapping” block in the player sprite, it doesn’t know about the “rope” object. That’s why it is not working.
Also, testing for objects overlapping frame by frame is very expensive. Since you already know the position of the rope, it is much simpler to check the distance between the player and the rope. You only need to calculate the 2D distance between them, and if it is a small number, then you know the player is very close to the rope.
Also, the way you handle the key presses is not optimal. For example, in “when w key pressed”, you have the block to wait until key w is pressed or the object is blocked below. But when the w key is pressed again, this stack will be triggered again. Overall, this will make the project run slowly and not smoothly. Instead, we recommend you use a single forever loop to handle all keys and conditions, but each key press is handled instantly. You can check out this project for an example: play.creaticode.com/projects/66e823b5a634f8ee7d92cc88/editor?version=1
-
When I use the distance between block, it doesn’t change value no matter where the player moves and just stays at the value 100000000.
-
Please refer to this example:
play.creaticode.com/projects/675378ad977fa780536fd819
The idea is that we already know the position of the rope, then we just need to know the position of the player, then calculate the direct distance between these 2 2D coordinates.