#How do I show the collider of a highlighted Entity in sceneview when using Unity Physics colliders?

1 messages · Page 1 of 1 (latest)

fallow sphinx
#

Question says it all.

#

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."?

proven nova
#

yes

fallow sphinx
#

so that will draw all colliders in my game

proven nova
#

yes

fallow sphinx
#

no easy way to draw individual colliders as I highlight that entity, eh?

proven nova
#

not without custom code i dont think

fallow sphinx
#

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

proven nova
#

it's almost like it's time consuming to replicate 15 years of debug features ^^

fallow sphinx
#

i'm gonna whine anyway

proven nova
#

oh we all do 😄

languid kindle
#

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

fallow sphinx
#

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

fallow sphinx
#

It's the same case as ConvexCollider for the MeshCollider as well

fallow sphinx
#

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)

fallow sphinx
#

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

languid kindle
#

And specify your assemblies

fallow sphinx
#

I see what you mean, I think. Just make a file with an asmref that makes it public or whatever