|
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!
(comments are locked)
|
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. 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 coming from the floor, right? Thanks.
Mar 27 '12 at 09:14 PM
sndwav
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.
Mar 28 '12 at 03:24 AM
rutter
(comments are locked)
|
|
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!
(comments are locked)
|

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