Invisible colliders

Hi,

what is the default way to add invisible colliders. Like a cylinder for players and an optimized collision mesh for a map? My guess would be to use meshes, but these colliders should not render and should only be used for collision checking and it seems like the mesh class includes a lot of overhead if you use it only for collisions.

However if meshes are the only available way, how would i exclude it from rendering while still being part of the scene?

Kind regards
ardo

Hello and welcome!!!

You are right: you can use simple meshes and just flag them with mesh.isVisible = false

2 Likes

!!

I was making a material and doing mesh.material.alpha = 0

This helps a lot!

1 Like

mesh.isVisible = false - disables the collider aswell. i tested this with raycasts…