INVISIBLE COLLISION MESHES | UNITY
Learn how to create invisible collision meshes in Houdini using the collision_geo primitive group for use in game engines.
- Install, instantiate, and unlock the Collisions_InvisibleCollisionMeshes_Start.hda example in Houdini.
- Go inside the Collisions_InvisibleCollisionMeshes1 node in the network editor.
- Here we have a OBJ node, planet, with a fairly dense mesh. We want to create a lighter mesh that approximates the planet for its collision geometry.
- Create Sphere OBJ node by hitting Tab, typing sphere, and pressing Enter.
- Go inside the newly created Sphere OBJ, sphere, and select the Sphere SOP, sphere1.
- In its parameters, change Primitive Type to Polygon.
- Hit Tab, type group, and press Enter to create a Group SOP.
- Connect sphere1 to the first input of the newly created group1 node and move the blue display flag from sphere1 to group1.
- In group1 node's parameters, set its Group Name parameter to collision_geo, Entity to Primitives, and Number > Pattern to *.
- In Houdini's top-menu, click on Assets > Save Asset > Collisions_InvisibleCollisionMeshes.
- Go to Houdini Engine > Load Houdini Asset... and find your Collisions_InvisibleCollisionMeshes_Start.hda asset.
- In the Inspector, make sure Asset Settings > Auto Select Asset Root Node is disabled.
- In the Hierarchy window dive down to and select Collisions_InvisibleCollisionMeshes1 > sphere > group1 > collision_geo_0.
- Notice the Mesh Collider component.
- Instantiate in Unity the HoudiniAsteroid prefab from HoudiniAsteroid.unitypackage somewhere above the planet.
- Press Play in Unity and watch the asteroid hit the planet's collider.