Click or drag to resize

MeshesCreatePrimitive Method

Creates a primitive mesh without colliders 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
Syntax
C#
public static GameObject CreatePrimitive(
	PrimitiveType type,
	Vector3 meshScale,
	Material material,
	Transform parent
)
Request Example View Source

Parameters

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: GameObject
The game object of the new primitive.
Remarks
See Also