Can I stop Collision Polygon from rotating?

0 favourites
  • 4 posts
  • A rather simple question really; is there any way that I can stop a collision polygon from rotating if the sprite needs to be rotated - it seems to be causing multiple problems with pathfinding.

    Thanks in advance :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Um...I know one thing you can do is use an invisible sprite for collision detection and pin the visible object to that, then the visible object can rotate and the other sprite doesn't have to. I don't know if that helps but I don't believe you can actually prevent an objects collision box from rotating if the object is rotating.

  • Yeah, after a little messing around, this is the solution I also came up with. It basically means treating the character as a tank - movement on the base with no rotation with a rotating character pinned on top that controls the shooting. Speaking of which, is it better to pin, or attach every tick?

    I was also just curious if there were any other methods?

  • I was also just curious if there were any other methods?

    I think the invisible collision box sprite pinned is the best method.

    As to rather pin or move every tick, it really depends on what is going on in your game.

    Pinning (position only) on start of layout or on creation of the sprite/object/character will allow you to only deal with it once and rest assured the collision polygon you're looking for will always be aligned with its correct sprite, at the correct angle no matter what.

    Positioning every tick allows you to be able to have a more precise control over the positioning in case you would like to have some offset, or apply some special operations at will.

    There is no "absolute best" here, just what fits best the game you're making.

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