[(mostly) solved] Argh why won't the collisions worrrrk

This forum is currently in read-only mode.
  • Cap is here. So I tried applying physics with bounding box to the TiledBackgrounds, collisions were horribly messed up. Okay, I thought, guess tiledbackground doesn't like to play along with physics, I'll make a foreach loop to put a physics enabled Sprite over each tiledbackground to handle collision, result: Collisions are EVEN MORE fucked up!

    <img src="http://sae.tweek.us/static/images/emoticons/emot-bang.gif">

    version is 0.99.84, doesn't work in latest stable either. I'm sure I'm doing something really stupid but for the life of me I can't figure out what so someone please help pretty please

  • The hotspot on your physics sprite needs to be centered for collisions to work properly. You'll have to compensate for new hotspot to get the sprites lined up with the backgrounds, but that's pretty easy:

    X: TiledBackground.X + TiledBackground.Width / 2

    Y: TiledBackground.Y + TiledBackground.Height / 2

    I hope this helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah, that fixed it, thank you.

    But the reason I don't usually centre hotspots is because the object then no longer aligns to the grid properly. I'm assuming the physics broken-ness when the hotspot is non-centre is considered a bug?

  • Ah, that fixed it, thank you.

    But the reason I don't usually centre hotspots is because the object then no longer aligns to the grid properly. I'm assuming the physics broken-ness when the hotspot is non-centre is considered a bug?

    im pretty sure it is. theres a line of code that should be in there somewhere but isn't. the line of code which places the center of rotation in the center of the sprite for physics purposes.

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