We’ve been reworking some of the UI/UX aspects of the built-in physics debugger lately, and I’d love to share some early progress with you on this thread. Here is a link to an experimental build that I’ve prepared: https://beta.unity3d.com/download/cd910d1ebf55/public_download.html
Here is a short description of what has been addressed so far:
Split the Physics Debug window into Filtering, Rendering, Info, and Contacts tabs for easier access and space management
Moved the Rigidbody and Articulation Body info sections to the Info tab (and added some more info for debugging)
Added the option to visualize the center of mass or the inertia tensor of Rigidbodies or Articulation Bodies that are being tracked in the Info tab
Added Contact visualization that can be filtered by using settings in the Filtering tab
Known limitations:
Changing filtering settings while stepping frame by frame during Play Mode will not take effect until the next simulation step
Turning on the Show All Contacts option during play mode will not show contacts of Colliders that have already been initialized.
Things that are being considered:
In addition to being able to filter by Physics Scene, add an option to filter by Unity Scene.
Expose Rigidbody and Articulation Body velocity and acceleration accumulators. This could be employed to get an estimate of the total external force applied this frame
Let me know what you think, can’t wait to hear any feedback.
One of the things I saw requested way back when for this before you worked on it, was for visualisation of capsule and raycasts. In particular what gets people a bit confused are capsule casts, because the shape can be bigger than people expect.
People think it’s a bug when really they fail to visualise it properly and understand that beginning the cast inside an object will reject it. This will affect capsule cast the most (and swept shapes).
Good idea and I don’t think it would be difficult to implement. Thanks for the feedback!
Weird, I’m still unable to reproduce the issue after following your screenshot as closely as possible. If this is an issue that you can consistently reproduce, could you provide the repro steps? I’m really curious why this is not working for you.
Another bit of feedback: I would put the “Info” tab at the start or the end because it’s the only tab with passive information and a miscellaneous meaning (it sits badly nested among tabs that can be interacted with which have strong meaning) and because it’s likely the most commonly accessed tab now you’ve moved info from the RB component into another window, so you want to easily get to that Info.
For a busy dev, that would be start or end - quickly and easily found / clicked with muscle memory.
The contact impulses are per-contact, or the overall value calculated by Unity?
Because currently only the overall value is exposed by Unity. A good and easy push in physics would be exposing the impulse per-contact, exactly as PhysX does (indeed, there’s no such overall value in PhysX).
Hi, this might be overdue but the per-contact impulses are now exposed and used in this build. This will also be included in the final product. Thanks for taking a look!
Just to refine on what Augustinas just said, per-point contact impulses is in a PR towards trunk now, expected to land sometime soon, and become available in a public alpha of 22.1. I can totally remember you asking about it since forever.
Unity Physx integration is fundamental to all the work we do, without it and these updates we’d have moved to Unreal because we really needed contact modification. Now there’s also better visualisations as well! Please don’t stop improving Unity’s built in Physics.
Can’t wait for what’s next. If it was me I’d definitely hire more to help out, seems like the team is small (and extremely hard working) for the amount of heavy lifting Physics does in Unity.
There is query visualization for check, overlap and cast query types, and the visualization can be filtered independently in the new “Query” tab. Here’s a gif of the visualization in action:
Also, the Info tab is now at the start of the row + some other minor fixes.
That would be the best way, of course. But to me, simply drawing the wireframe of the collider(s) at the start and at the end with a raycast line connecting the center of masses would suffice.
Indeed, and I feel the omission of swept shapes is an unfortunate one, even seeing it in the visualiser would encourage people to find out more about these useful functions.