Physics angular velocity damage problem

  • hello, i have problem with dealing damage, im using Physics behaviors

    Cannon ball and bricks

    When cannon ball have collision with bricks i substract from Brick HP Ball.physics.angularVelocity & Ball.Physics.density

    And this do not substract.

    I check in inspector and HP are growing!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Angular velocity value can be negative, add abs() expression.

  • Angular velocity value can be negative, add abs() expression.

    "abs(BALL.Physics.AngularVelocity) & BALL.Physics.Density"

    when i add abs expression, event substract always 1 from hp

  • That’s because & is an “and” operator. If both numbers are non-zero then the result is 1.

    You probably want to add the numbers together or something.

  • That’s because & is an “and” operator. If both numbers are non-zero then the result is 1.

    You probably want to add the numbers together or something.

    Yes, speed of ball and his density should sum and substract from brick hp

  • So you’ll want to use + instead of & to add them together.

  • So you’ll want to use + instead of & to add them together.

    i use this

    abs(BALL.Physics.AngularVelocity) + BALL.Physics.Density

    also dont work correctly

  • What exactly are you trying to achieve?

    Angular velocity is the speed of rotation. And density is basically mass of the object. Adding them together makes little sense.

    I'm guessing you need normal (linear) velocity. You can use VelocityX if your ball is moving horizontally, or this expression to get its overall velocity:

    distance(0, 0, Ball.Physics.VelocityX, VelocityY)

    Also, you should probably multiply velocity and density together, not add them.

    .

    Add a text object to your layout and print the result of this formula to see what numbers it's generating.

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