Position Y doesn't work properly in game

0 favourites
  • 14 posts
From the Asset Store
Graphic - Alien UFO
$1.80 USD
40% off
Vector illustration of a UFO with an alien in three different positions.
  • so, I was asking the question of teleporting megaman x and I noticed this happening. basically I want that: when X detects that "is overlapping at offset Y = 4" it will stop right on top of the object in red, finish doing the teleport animation and return the controls to the player so he can start playing freely.

    But, for some bizarre reason, it is way above the red object and even if I change the value to 3 or 2 it stops in the same place when loading the project but if I change the value to 1 or 0 the Y of the character stays the same to the Y of the object. I have no idea what's going on.

    I noticed another thing, that if I'm at the bottom of the layout the Y position works perfectly. as you can see in the image below.

    but if it is above the layout, the Y position breaks and it is positioned completely wrong. as you can see in the image below.

    I don't understand what's going on, could someone help me fix this?

  • Maybe the Y position is correct but the collision box of the player is lower than the graphics? That's what the floating looks like to me.

  • I thought about that too, but what explains at the bottom of the layout the player correctly colliding with the object in red?

  • if I compare the "on collision at offset Y" of the tilemap it also gives the same error.

  • The else condition only possible happens under "Arrive" animation right? So what other animation do with their respective action?

  • I thought about that too, but what explains at the bottom of the layout the player correctly colliding with the object in red?

    Are they different animations in each screenshot? Even different frames of the same animation can have different positioning or collision.

  • so I changed the events to detect if the player's collider is at the Y+4 offset of the red object. yet it stops a little further above the same object. it only stops on top of the object if the animation is the same as the teleport animation ("Arrive").

  • so I changed the events to detect if the player's collider is at the Y+4 offset of the red object. yet it stops a little further above the same object. it only stops on top of the object if the animation is the same as the teleport animation ("Arrive").

    Could you make a video demonstrating the problem? No idea what any of this means

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • how do i post a video here?

  • You could share a dropbox link to the video or upload a gif somewhere

  • Well first of all those events are different to what you shared in the screenshot and are using different objects so thanks for that confusion. You have a separate event there that says on animation finished set platform behaviour enabled, how do we know that when the block is at the top that the invisible animation had time to finish? Probably the oject is floating as a sprite with disabled platform then platform is enabled some time later which is why you see it drop. When it drops down to the lower level probably the animation has finished so platform is enabled on time. But I can only guess because it's invisible.

  • dropbox.com/s/rfok0908gqrb5s5/ScreenRecorderProject2.mp4

    ok, sorry for the confusion. before recording the video I had done some tests using the character's collision box and not using the sprite anymore. how could i fix this, i still don't understand what is going on.

  • dropbox.com/s/5w7wzmbzf1i4m61/ScreenRecorderProject3.mp4

    I apparently figured out the problem. I remembered what you had said about the behavior of the platform and if there was time for it to be activated before reaching the Y position of the red object. I just switched the stocks, lol. It was as I thought the problem was so complex but it could be solved so easily. anyway, thanks for your help guys, and sorry again for the confusion, now I can continue in peace that this damn thing has been resolved.

    thank you very mutch!!!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)