MeshesCreatePrimitiveWithCollider Method |
Creates a primitive and attaches it to the model.
Namespace:
KSPDev.ModelUtils
Assembly:
KSPDev_Utils.2.5 (in KSPDev_Utils.2.5.dll) Version: 2.5 for KSP v1
Syntaxpublic static GameObject CreatePrimitiveWithCollider(
PrimitiveType type,
Vector3 meshScale,
Material material,
Transform parent
)
Request Example
View SourceParameters
- type
- Type: UnityEnginePrimitiveType
The type of the primitive. - meshScale
- Type: UnityEngineVector3
The scale to bring all the mesh vertices to. The scale is applied on the mesh, i.e. it's
applied on the vertices, not the transform.
- material
- Type: UnityEngineMaterial
The material to use for the primitive. - parent
- Type: UnityEngineTransform
The parent transform to attach the primitive to.
Return Value
Type:
GameObjectThe game object of the new primitive.
Remarks
For Cylinder Z and Y axis will be swapped to make Z "the length". The primitive will
have a collider of the appropriate type.
See Also