Support for primitive colliders?

   2422   2   1
User Avatar
Member
13 posts
Joined: Aug. 2017
Offline
From what I understand you can simply Group primitives as colliders and on the Unity side you'll get a mesh collider. These are rather expensive and dynamic geomtry really needs to be made out of compound primitive colliders that approximate the object and achieve good performance.

So that begs the question is it possible to somehow export primitive colliders to Unity? Say you define on this point spawn a sphere collider with radius x, on this other point spawn a capsule with height y and radius z etc.
Edited by Erik - Jan. 14, 2019 11:37:59
User Avatar
Member
571 posts
Joined: May 2017
Offline
Yes, there are 2 ways to get simple Unity colliders to be attached:

1. In Unity, on the Houdini Engine Unity Plugin Settings window (accessed through HoudiniEngine > Plugin Settings), turn on the Support Houdini Box Type or Support Houdini Sphere Type checkbox. Then in your HDA, simply create a Box node and group it with name collision_geo. The reason the Support Houdini Box Type is disabled by default is because it turn turns all box geometry into separate parts, which folks might not want.


2. Using the unity_script custom string attribute, you can attach any component script from your project to the output gameobject. Therefore, this allows to attach any standard Unity components such as Box Collider, Sphere Collider, etc. For more info: https://www.sidefx.com/forum/topic/56181/ [www.sidefx.com]
User Avatar
Member
5 posts
Joined: Oct. 2018
Offline
Hello

I've been fighting for a few days with these colliders.

I've made a simple digital asset and added it a box as collider in Houdini with a group named collision_geo. (I previsouly turned on Support Houdini Box Type and Sphere Type in the Plugin Settings in Unity)
However, in Unity, the collider seems to appear as a white box. As if Unity couldn't understand it was a collider. I've checked my nodes again and again, all seems right. (My other digital assets' colliders works perfectly well with the group collision_geo)

And when I unckeck the Houdini Box and Sphere Support, Unity recognizes the collider as a Mesh Collider. (juste like the Wall on the left)
Is there a bug or something with the Houdini Box and Sphere Collider support ? Or maybe am I doing something wrong ?
(I also tried with the unity_script method, however the collider doesn't update with the Digital Asset parameters, and I'm not good enough at programming to make my own scripts…)

(I'm working with Houdini 17.0.416 Indie version)


Edit :

I've found the origin of the problem : it was the input order of the merge node. The collider needs to be the first node connected to the merge.

Well, that's a relief
Edited by Statikomelon - Jan. 17, 2019 11:11:43

Attachments:
Collider_houdini.PNG (570.8 KB)
collider_unity.PNG (716.0 KB)
DA_TreilleWall.hdalc (40.6 KB)

  • Quick Links