physics problem when rotating layer

0 favourites
  • 8 posts
From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • Hi

    I have a sprite falling from top and some breaks placed around.

    When I rotate the layer of the breaks the sprite is still hitting them

    were they originally where before any rotation.

    how can i fix that?

  • I'm having the same issue with the platform behavior.

    It doesn't happen when you rotate the whole layout, or if the sprite and your obstacles are in the same layer.

    (But in my case, I still need to have multiple layers :/)

  • Consider that the rotated layer is the object to which the rotation is applied. Only its coordinates and angle are modified.

    But for any object that belongs to this layer there is no modification of coordinates or angle, it hasn't moved, its support moved.

    The solution I came up with is to use another object type that I spawn under the visual elements. This object type (let's call it CM) is my collision mask. This object has the physics behavior.

    Also it is spawned in the same layer as the physical object the player controls.

    But the twist is to spawn the CM according to the current rotation of the layer.

    This calls for a bit of maths trickery and setting of the project.

    A capx

    This is the actual system I'll use for the contest. Please learn from it, don't simply rip it off.

    It's highly uncommented though, and still a WIP.

  • Kyatric : Thank you very much for sharing this solution. It is really interesting to see the way you have used trigonometric functions to determine the locations to create collision masks.

    I wish you all the best for the competition.

  • Was this problem ever fixed formally? Would make sense for collision box to move with sprites. I still have the problem with build 99.

    I want to make a game based on this rotation, so having this patched up would be great. Sorry if there's already a fix. I've been away for a while. =D

  • Ashley

    Is this considered a bug, or expected behaviour. I was also wanting to rotate a layer, expecting the collision boundaries to rotate, not remain invisibly behind. I've also had to rotate everything manually, which is a pain.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see I am way behind on this, but as of r110 this is still an issue; I've asked for help several times and people just say, "Post the .capx" It makes no sense at all to move each object, calculate a bunch of math and make a collision mask. (forehead slap) I thought by creating different layers and placing objects on that layer, this would resolve the issue. Nope. Logically it should function as simply as you would expect. Rotate the layer, and all it's objects. Yeah, it does. But the gravity physics also rotates, WTH? No, I only rotated a layer with static objects (solids). Layer0 should remain the default gravity for my avatar.

  • I see I am way behind on this, but as of r110 this is still an issue; I've asked for help several times and people just say, "Post the .capx" It makes no sense at all to move each object, calculate a bunch of math and make a collision mask. (forehead slap) I thought by creating different layers and placing objects on that layer, this would resolve the issue. Nope. Logically it should function as simply as you would expect. Rotate the layer, and all it's objects. Yeah, it does. But the gravity physics also rotates, WTH? No, I only rotated a layer with static objects (solids). Layer0 should remain the default gravity for my avatar. <img src="smileys/smiley7.gif" border="0" align="middle" />

    I'll post my .capx with everything (little commenting) if someone feels they can point out my mistake (don't honestly think it's my mistake)

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