Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

var convex: bool;
bool convex;
convex as bool

Description

Use a convex collider from the mesh.

This means that if you have this set to true, your mesh collider wont have Holes or entrances. Convex meshes can collide with other convex colliders and non-convex meshes. Thus convex mesh colliders are suitable on rigidibodies, if you really need more detailed colliders than what the primitive colliders provide you with.

	transform.collider.convex = true;
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Example() {
        transform.collider.convex = true;
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Example() as void:
		transform.collider.convex = true