luke7eco's Recent Forum Activity

  • Hi

    I have a box (without cover) and balls inside (with Physics behavior). Balls have boolean instance variable: InBox = true

    I added an invisible sprite on the top of the box. When I rotate a box, balls fall out (on collision with sprite change boolean from true to false).

    Problem:

    I need to disable collisions of Instances (that have instance variable InBox=false) with object family.

    I tried to do it using the Invert InBox condition and action: Disable Physics collision with Family, but it disables all collisions (not only for instances with InBox=false).

    How to disable collisions only for instances with specific instance variables?

    Thank you for any help.

  • Try Construct 3

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

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

    Let me know how I can get your latest LFJS addon because your itch is unavailable.

    I need this addon or someone's recommendations on how to import WASM (WebAssembly) Liquidfun v7.0.0 (Github) to Construct 3 and how to create particles and kinematic bodies using this JS.

    Thanks

  • Here's one idea:

    Attach the bowl to an immovable physics object with a revolute joint.

    Then change the angular velocity to turn toward the angle you want.

    Details with some more explanations:

    https://www.dropbox.com/s/fp0hrl9f73f10yh/physics_rotate_bowl.capx?dl=1

    In general think of setting angle or position of physics objects as the same thing as teleporting. In your example you set the angle directly so if you rotated the bowl object fast enough the balls could suddenly be on the other side of the walls of the bowl. The physics engine won't think the balls went though the walls.

    However when setting velocities the physics engine can do it's magic to avoid jumping through walls. Especially if the "bullet" setting is enabled which does continuous collision detection.

    Thank you so much for your explanation and example.

    Changed collision polygon for Ball in your example, spawn 100 balls and on fast speed slider dragging (right-left) some balls can pass through the walls or stuck inside despite only Physics behavior.

    If I enable Bullet setting for the ball or bowl (continuous collision detection), mass of balls pushes the bowl down (bowl flies down). How to prevent it?

  • For physics to work best you'll want the motion of objects to only be handled by the physics behavior. Any other behavior will interfere. Also at no time use set position or angle. You can set angular/linear velocities, apply forces or impulses to move things.

    For something like a rotating box you'll need to do that with joints to put it together. Then with the "bullet" setting the balls will bounce off walls no matter how thin.

    https://www.dropbox.com/s/yh0tj716maey831/continuous_collisions.capx?dl=1

    Of course you still can overpower the joints at times, but usually it's stable.

    Thank you for your example.

    I use a slider to change the angle of the box (with a limitation of movement between 0 and -120 degrees). Also, my box is a full-piece sprite. Balls have small collisions (as mentioned before).

    My brain is blowing up how to do it only using Physics behavior.

    GIF Image

  • Only use the physics behavior, and there’s a continuous collision detection check mark I think.

    Physics doesn’t work with other behaviors.

    This would probably work if the balls had the size of the collisions as the width of the Sprite. But for my purposes collision polygon of the ball is smaller than Sprites width and height.

  • Only use the physics behavior, and there’s a continuous collision detection check mark I think.

    Physics doesn’t work with other behaviors.

    I've already tried to use only Physics behavior for box and balls but it does not work. When I change the angle of the box, balls pass through the box walls (despite collisions and Immovable mark).

    Adding 8Direction behavior to the ball and Solid to the box allows keeping balls inside of the box when I slowly change the angle. But if I change the angle fast, balls still pass through the box walls.

  • Currently, only have thoughts about adding very wide invisible rectangles (with solid behavior) as a child to the box walls.

    Perhaps there is a better way to implement this?

  • Hi

    I have 2 objects:

    - box

    - balls (many instances inside of the box). Important: balls have smaller collision polygons than their size (approximately 30% in the center)

    Box has Physics (Immovable) and Solid behavior.

    Ball has Physics and 8Direction behavior (for interaction with solids).

    When I fastly rotate a box (or when the box hits the edge of layout) balls pass through it despite collision polygons. How to prevent it?

    Thanks.

  • Hi

    I have a custom slider that I created using this tutorial (with slight changes):

    Subscribe to Construct videos now

    I have a Global number InitialSliderPercent = 100 (so by default it is fully filled)

    I also have another object whose angle I want to change when the slider moves.

    On start of layout that object probably is at 0 degrees and when I move the slider that object must rotate (change angle) to the left to a maximum of -120 degrees (when the slider circle is on 0).

    How to rotate/change angle of the object from 0 to -120 (degree by degree) by changing the position of SliderCircle.X from SliderBack.BBoxRight to SliderBack.BBoxLeft?

    I will be grateful for your help.

    Tagged:

  • works good

    Thank you

  • Painted a bit

  • Hi everybody

    Hope someone will help me with this.

    Imagine that we have 2 objects (sprites):

    - box

    - ball

    1 instance of "box" is placed on layer "Boxes"

    1 instance of "ball" is placed on layer "Balls"

    a box has behaviors: Physics (Immovable), DragDrop

    a ball has Physics behavior (so it has a gravity like a real-world ball)

    "On the start of layout" I "Destroy" a ball and create a Loop to Spawn 100 balls (instances) inside of the box.

    It works well when I run a preview (balls appear in the box)...

    Problem:

    ... but when I start to drag a box or rotate it balls are flipping out of the box - despite collision polygons.

    Looks like collision polygons of balls do not interact with collision polygons of box walls when I move the box.

    I want the balls:

    1) to stay inside the box (inside collision polygon)

    2) move inside the box if I change the box angle a bit (like in real-world)

    Need some help with it.

    Thanks)

luke7eco's avatar

luke7eco

Member since 28 Nov, 2020

None one is following luke7eco yet!

Trophy Case

  • 4-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

8/44
How to earn trophies