Set Origin problem on Ashley's tutorial - question

  • Hi,

    I've been following Ashley's tutorial on making a platform game and have come up against something I can't figure out.

    I set a rectangle as the 'platform' object and placed it over the player sprite. No problem so far. I also set the origin point at the bottom centre for both the sprite and the platform object as instructed.

    In Construct, the rectangle has been placed over the sprite, so that as per the tutorial the rectangle covers the body in the image, and I set the opacity to 50% so I could see it. Yet, when I run the game at this point with the platform object set to visible, it appears offset - the blue rectangle only covers part of the sprite's body because it has moved slightly to the left.

    How can I get the platform object to be placed on the sprite when running the game in the same place it appears within Construct please? I hope that makes sense?

    Cheers <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Create an event: At start of layout, set the sprite to the position of the rectangle, and pin it to the rectangle.

    If it's still offset then the origins must be off, or there's something else affecting the position of your sprite. Post your capx for us to see if you don't come right.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi GeometriX,

    There's an event set in the tutorial where every tick, the player sprite is "Set position to" the platform object.

    As the sprite and platform object are different widths, I wonder if it is the origin position then. Never thought of that. I'll have a mess around and see if moving the origin helps.

    Cheers for the suggestion.

  • Yep, you were right. I manually moved the origin point on the platform object and it is now in the correct position when the game runs.

    Thank you! <img src="smileys/smiley4.gif" border="0" align="middle" />

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