Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by GutoThomas · May 25, 2012 at 04:14 AM · physicsaddforcelaunch

Perfect oblique launch from point A to point B

Hey everyone, I'm with some tricky doubt here. Imagine we have a cannon which can shoot balls. In the 3D world I have an aim, which is the position where I want the ball to go. What's the best way to make the ball go in some sort of oblique launch in direction of the aim? Should I use AddForce based on distance between the cannon and the aim position in world ? Someone already implemented such a thing with success? It's not difficult to make the ball get closer to the aim. But what about make her hit the ground perfectly in the aim position?

Thanks from now!

Cheers.

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · May 25, 2012 at 06:26 AM 0
Share

Yes, just add a force. You could set the velocity.

Just use normal high-school physics to figure out what the initial velocity should be for the angle you are using.

avatar image GutoThomas · May 25, 2012 at 01:55 PM 0
Share

Thanks for the reply! I just taked a look at the angle function. I missed her. Now I think I'll get some results. I was considering the use of high-school physics(why create a new formula if we already have one, isn't? hehe) but I wasn't sure about the velocity. How I would convert force to velocity, but I forgot I can set the velocity by myself. =)

avatar image Kiloblargh · May 25, 2012 at 02:08 PM 0
Share

Were you not aware of Unity's built-in physics engine, or are you trying to avoid using it for network / performance reasons?

avatar image GutoThomas · May 25, 2012 at 02:13 PM 0
Share

Well. In my current project I want to avoid physics simulation as far as I can because it's a A.R game for mobile, so...

avatar image Fattie · May 25, 2012 at 02:23 PM 0
Share

Unitard, I think he just wants to know WHAT initial velocity to use, so that the ball WILL land in a certain spot. ie, yes the ball will travel under Unity's physics.

Is that right, José ?

Guto, there is absolutely no problem using Unity's physics in your AR game.

it sounds like you have a long way to go in mastering Unity, before performance will be an issue! enjoy!!

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
-1

Answer by TowerOfBricks · May 25, 2012 at 02:58 PM

That will require some math/physics. And I would not recommend using the Unity physics to do it. Setting the position of the ball is more stable. See this wikipedia page for more information: Trajectory of a Projectile I have done the maths before when I programmed a TD game, but I haven't got the code left.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · May 25, 2012 at 04:27 PM 0
Share

he's talking about PREDICTING the RESULT of using the PhysX to throw a stone. (which is - obviously - exactly the same as predicting it in the real world.) this has been explained some three times now :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to apply a force after launching the player? 0 Answers

Update speed and physics makes my rigidbody jiggle 2 Answers

AddForce forward also adding downward force 0 Answers

Moving an object using rigidbody.AddForce & keyboard input. 1 Answer

move player to its rotating direction? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges