Skip to content
Roblox API Reference

Model

Models are container objects, meaning they group objects together. They are best used to hold collections of BaseParts and have a number of functions that extend their functionality.
Memory category
BaseParts
Own members
35
Inherited members
79
Subclasses
5
Siblings
3

Properties39

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Inherited fromPVInstance2

Property categoryPivot

  • Editor-only property that displays and edits the pivot's CFrame relative to the instance, moving only the pivot and leaving the instance in place.
    • Not replicated
    • Not scriptable

Property categoryTransform

  • Editor-only property that reads and sets the world CFrame of the PVInstance's pivot, moving the entire instance when changed from the Studio Properties window.
    • Not replicated
    • Not scriptable
Defined byModel14

Property categoryAppearance

Property categoryBehavior

Property categoryData

Property categoryPivot

  • Model.PrimaryPart: BasePart
    The primary part of the Model, or nil if not explicitly set.
  • Model.Scale: number = 1
    Editor-only property used to scale the model around its pivot. Setting this property will move the scale as though Model:ScaleTo() was called on it.
    • Not replicated
    • Not scriptable
  • Model.ScaleFactor: number = 1
    • Hidden
    • Not scriptable
  • Model.WorldPivot: CFrame = CFrame.identity
    Determines where the pivot of a Model which does not have a set Model.PrimaryPart is located.
    • Not replicated
  • Model.WorldPivotData: CFrame?
    • Hidden
    • Not scriptable

Methods65

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Inherited fromPVInstance2
Defined byModel21
  • Model:AddPersistentPlayer(playerInstance: Player? = nil)
    Sets this model to be persistent for the specified player. ModelStreamingMode must be set to PersistentPerPlayer for behavior to be changed as a result of addition.
    Parameters
    ParameterDescription
    playerInstance: Player? = nil
    The Player to make this model persistent for.
  • Model:GetBoundingBox(): (CFrame, Vector3)
    Returns a description of a volume that contains all parts of a Model.
    Returns
    TypeDescription
    (CFrame, Vector3)
    A CFrame representing the orientation of the volume followed by a Vector3 representing the size of the volume.
  • Model:GetExtentsSize(): Vector3
    Returns the size of the smallest bounding box that contains all of the BaseParts in the Model, aligned with the Model.PrimaryPart if it is set.
    Returns
    TypeDescription
    Vector3
    The Vector3 extents size of the Model.
  • Model:GetPersistentPlayers(): { Instance }
    Returns all the Player objects that this model object is persistent for. Behavior varies based on whether this method is called from a Script or a LocalScript.
    Returns
    TypeDescription
    { Instance }
    A table with all the Player objects that this model object is persistent for.
  • Model:GetScale(): number
    Returns the canonical scale of the model, which defaults to 1 for newly created models and will change as it is scaled via Model:ScaleTo().
    • Simulation access
    Returns
    TypeDescription
    number
    The current canonical scale factor of the model.
  • Model:MoveTo(position: Vector3)
    Moves the PrimaryPart to the given position. If a primary part has not been specified, the root part of the model will be used.
    Parameters
    ParameterDescription
    position: Vector3
    The Vector3 the Model is moved to.
  • Model:RemovePersistentPlayer(playerInstance: Player? = nil)
    Makes this model no longer persistent for the specified player. ModelStreamingMode must be set to PersistentPerPlayer for behavior to be changed as a result of removal.
    Parameters
    ParameterDescription
    playerInstance: Player? = nil
    The Player to make this model no longer persistent for.
  • Model:ScaleTo(newScaleFactor: number)
    Sets the scale factor of the model, adjusting the sizing and location of all descendant Instances such that they have that scale factor relative to their initial sizes and locations when scale factor was 1.
    Parameters
    ParameterDescription
    newScaleFactor: number
    The new scale factor for the model, which must be a positive non-zero number. A value of 1 represents the model's original size.
  • Model:TranslateBy(delta: Vector3)
    Shifts a Model by the given Vector3 offset, preserving the model's orientation. If another BasePart or Terrain already exists at the new position then the Model will overlap said object.
    Parameters
    ParameterDescription
    delta: Vector3
    The Vector3 to translate the Model by.
  • Model:BreakJoints()
    Deprecated:
    Breaks connections between BaseParts, including surface connections with any adjacent parts, WeldConstraints and all Welds and other JointInstances.
    • Deprecated
  • Model:GetModelCFrame(): CFrame
    Deprecated: This function has been deprecated as it did not provide reliable results. You can instead use Model:GetPrimaryPartCFrame() to retrieve the CFrame of the model's primary part.
    This value historically returned the CFrame of a central position in the model.
    • Deprecated
    Returns
    TypeDescription
    CFrame
    A CFrame representing a central position in the model.

    Use GetPrimaryPartCFrame instead.

  • Model:GetModelSize(): Vector3
    Deprecated: This item is deprecated. Do not use it for new work. Developers can instead use Model.GetExtentsSize.
    Returns the Vector3 size of the Model.
    • Deprecated
    Returns
    TypeDescription
    Vector3
    The Vector3 size of the Model.

    Use GetExtentsSize instead.

  • Model:GetPrimaryPartCFrame(): CFrame
    Deprecated:
    Returns the CFrame of the model's Model.PrimaryPart. This function will throw an error if no primary part exists for the Model.
    • Deprecated
    Returns
    TypeDescription
    CFrame
    The CFrame of the model's Model.PrimaryPart.

    Use GetPivot instead.

  • Model:MakeJoints()
    Deprecated: This joint type has been deprecated. Don't use it for new work. Use WeldConstraints and HingeConstraints instead.
    Goes through all BaseParts in the Model. If any part's side has a SurfaceType that can make a joint it will create a joint with any adjacent parts.
    • Deprecated
  • Model:ResetOrientationToIdentity()
    Deprecated: This function has been deprecated; it remains to prevent legacy scripts from throwing errors, but it does nothing when called.
    Resets the rotation of the model's parts to the previously set identity rotation, which is done through the Model:SetIdentityOrientation() method.
    • Deprecated

    Use SetPrimaryPartCFrame instead.

  • Model:SetIdentityOrientation()
    Deprecated: This function has been deprecated; it remains to prevent legacy scripts from throwing errors, but it does nothing when called.
    Sets the identity rotation of the given model, allowing you to reset the rotation of the entire model later, through the use of the ResetOrientationToIdentity method.
    • Deprecated

    Use SetPrimaryPartCFrame instead.

  • Model:SetPrimaryPartCFrame(cframe: CFrame)
    Deprecated:
    Sets the BasePart.CFrame of the model's Model.PrimaryPart. All other parts in the model will also be moved and will maintain their orientation and offset respective to the Model.PrimaryPart.
    • Deprecated
    Parameters
    ParameterDescription
    cframe: CFrame
    The CFrame to be set.

    Use PivotTo instead.

  • Model:breakJoints()
    Deprecated: This deprecated function is a variant of Model:BreakJoints() which should be used instead.
    • Deprecated

    Use BreakJoints instead.

  • Model:makeJoints()
    Deprecated: This deprecated function is a variant of Model:MakeJoints() which should be used instead.
    • Deprecated

    Use MakeJoints instead.

  • Model:move(location: Vector3)
    Deprecated: This item has been superseded by Model:MoveTo() which should be used in all new work
    • Deprecated
    Parameters
    Parameter
    location: Vector3

    Use MoveTo instead.

  • Model:moveTo(location: Vector3)
    Deprecated: This deprecated function is a variant of Model:MoveTo() which should be used instead.
    • Deprecated
    Parameters
    Parameter
    location: Vector3

    Use MoveTo instead.

Events10

Inherited fromObject1
Inherited fromInstance9