- Home /
Hooking RigidBody.AddForce
For my application, I need to know when a force is applied to a Rigidbody. Is there any way I can override or otherwise hook the AddForce method? Ideally I'd like to do this from a MonoBehavior.
I tried subclassing Rigidbody but its defined as final/sealed :(
I've been doing some googling and apparently this sealing of classes is new. Its also a monstrous mistake. As someone who spent a great many years in the tool groups of companies like Crystal Dynamics, I cna tell you that the less flexibile your tool is for the developer, the more developers will reject it.
Trust your developers and empower them to do serious engineering, or your tool just becomes a toy.
Actually, I believe that Unity classes have always been sealed. At least since 2.1 when I purchased Unity. And that was over 2 years ago.
See this other question....
http://answers.unity3d.com/questions/15522/unity-3-sealed-class-gameobject
So the question becomes... how do i hook AddFroce and AddTorque? Certainly this is not an unreasonable thing to want a physics engine to notify my code of.
Your answer
Follow this Question
Related Questions
Set Velocity at relative position. 2 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Rigidbody sphere slows down quickly 2 Answers
Physics update rate problems 1 Answer
RigidBody Script Conflict 1 Answer