#How do I show the collider of a highlighted Entity in sceneview when using Unity Physics colliders?
1 messages · Page 1 of 1 (latest)
One more qualifier actually "at runtime"
Is the answer "Add Physics Debug Display component to a GameObject and bake it onto an Entity and load that sub-scene when starting your game."?
yes
so that will draw all colliders in my game
yes
no easy way to draw individual colliders as I highlight that entity, eh?
not without custom code i dont think
unless I write my own thing, right
Unity certainly still has a lot of features they don't support anymore that I hope come back 😄
i know they've always had a philosophy of "write your own" at some point, but I hope the line hasn't changed this drastically
it's almost like it's time consuming to replicate 15 years of debug features ^^
i'm gonna whine anyway
oh we all do 😄
so, one of the ways: custom collider drawing script
if you have Aline
you can easily implement one
basically a presentation system that checks for EntitySelectionProxy
and if it exists and has physics collider - draws it
It seems like it is not possible to create a visualization for a ConvexCollider
they hide the ConvexHull as an internal reference
unless, maybe, I do the asmref trick and associate my code with its DLL or however that works
yeah that trick does work, lets me access the ConvexHull
i think it locks me out of my own namespaces though, which sucks
It's the same case as ConvexCollider for the MeshCollider as well
Also the CompoundCollider has a child in it with a ColliderType that is way outside the bounds of the ColliderType enum for some reason.
Like it's ColliderType is 155 or 176.
I was expecting CompoundCollider's children to all be valid collider types that I could draw individually (should they be made of primitive colliders that is)
Nevermind about the CompoundCollider problem, turns out trying to draw the colliders by iterating through compoundCollider->Children was producing garbage data.
I switched to getting the ColliderKey for each Child and using compoundCollider->GetChild and it worked how I expected it to
Do that to just make a file with attribute 'InternalsVisibleTo"
And specify your assemblies
I see what you mean, I think. Just make a file with an asmref that makes it public or whatever