Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8060225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:55:10+00:00 2026-06-05T09:55:10+00:00

I have a physics body (Balloons) and I am applying an impulse on collision.

  • 0

I have a physics body (Balloons) and I am applying an impulse on collision.

What I want is that when the “player” collides with the balloons then it should move up (which is working pretty good), but it should take some angle according to the shape of the balloons when hit. It shouldn’t always move vertically up.

It should move straight up only when hit at the topmost part of the balloons. In other cases it should move up with some angle.
How can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:55:11+00:00Added an answer on June 5, 2026 at 9:55 am

    From what I think your asking, here’s one way to do it:

    You can find the angle of impact from the positions of your two objects (your player and the balloon). So you’ve got balloon.x, balloon.y, player.x, player.y.

    -- Two sides of a triangle opp and adj to the angle
    sideO = balloon.y-player.y  -- the opposite side
    sideA = balloon.x-player.x  -- the adjacent side
    
    -- To get the angle
    angle = math.atan(sideO/sideA)
    

    This may be backwards from what you want. If it is just try player.x-balloon.x instead (and same for y).

    Here’s where I got the math.
    Also, the lua math library

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When should an object to put in a resting state for physics? I have
I have started to learn game physics and I am trying to move a
I have a string like: $string = /physics/mechanics/vectors/P-M-C (1).doc; I want to get like
are there any light 3d iphone libraries that have: Physics ( ragdoll physics )
Hey guys i have a question here, How do i create a body that
I have a QGraphicsScene with about 1000 QGraphicsItems, which are actually physics items. Each
I have a C++ code that's a physics simulation tool. I would like to
I'm using Box2d for a Bike Physics Game, Box2d lets you have fixtures that
Recently I have a new project that uses Box2D as physics engine. And I
I have a physics simulation and it allows you to place area constraints, so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.