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 sndwav · Mar 27, 2012 at 08:07 PM · physicsrigidbodyaddforceaddforceatposition

Add force on objects from a specific location in space

Hi. I'm trying to create some sort of a jet stream that rises from the floor, and if a rigidbody is wandering above that jet stream, it will get tossed around.

To my understanding, I can add force to objects, but I don't think I can actually make an object that spews out force.

Is the only way to do this by checking the position of each rigidbody, and if any are above the jet stream then add force (at position) to those bodies?

Also, how does AddForceAtPosition work? What is the position var exactly? A position limited to the body boundaries? a position in space?

Thanks for any help!

Comment
Add comment · Show 1
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 Branx · Mar 27, 2012 at 08:20 PM 0
Share

rigidbody.AddExplosionForce()? You will still have to apply this to each rigidbody..

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by rutter · Mar 27, 2012 at 09:03 PM

Also, how does AddForceAtPosition work? What is the position var exactly? A position limited to the body boundaries? a position in space?

`AddForce()` simply adds force to the rigidbody. It's simple and works in most cases, but can't model some interactions that require more control.

`AddForceAtPosition()` does the same thing, but also allows you to specify where the force is coming from -- you can think of this as modeling the point of contact when you "push" something. There's no absolute requirement that the position is inside or even close to your rigidbody, but your results will probably seem more realistic if it is.

If you've studied some physics, the key difference between the two functions is whether you're treating the rigidbody as a point particle or not. Adding a force at a specific position can also apply torque, causing your object to spin.

Comment
Add comment · Show 2 · 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 sndwav · Mar 27, 2012 at 09:14 PM 0
Share

Thanks, that cleared up my confusion about the position parameter.. Regarding my other question, if you have some insights and time: If I RayCast upwards from a point on the floor, and add an Upwards Force (from the position of that floor point with addforceatposition) to any object that intersects that ray, then it should theoretically simulate a jet of air co$$anonymous$$g from the floor, right? Thanks.

avatar image rutter · Mar 28, 2012 at 03:24 AM 0
Share

Sounds workable?

If you're intending to create persistent zones of effect, you could also try using a trigger collider to notify objects when they've entered a "force zone" (which they can then react to appropriately).

As far as the force position, that's a bit more complicated. Remember how I mentioned that you could think of the force position as a "point of contact"? Far-away points will cause more spin -- you can think of it as a sort of "lever arm", with longer and more angled levers producing more rotational push.

avatar image
0

Answer by Zero_Zagarth · Sep 27, 2012 at 07:22 PM

Hey men, that post should help you. http://answers.unity3d.com/questions/248788/calculating-ball-trajectory-in-full-3d-world.html There are any answer called BallisticVel and that works very nice! I hope it's useful for you.

Have a nice day!

Comment
Add comment · 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

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

Unity 2019.3.0f6 - Trouble with physics, cubes turn left after some meters 1 Answer

How to decrease inertia for a rolling ball 1 Answer

Object jumping while moving(with addForce) 0 Answers

add force to object that has 2 different rigid bodies 0 Answers

Confusion with AddForce with ForceMode.Acceleration 1 Answer


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