ModelRenderer:GetAnimation, ModelRenderer:SetAnimationEdit

[Animation] ModelRenderer:GetAnimation()
ModelRenderer:SetAnimation( [Animation] animation )

Gets or sets the current animation for this model. It will start playing right away unless you called ModelRenderer:StopAnimationPlayback.

You can get animations to use with SetAnimation by calling CraftStudio.FindAsset


ModelRenderer:StartAnimationPlayback( [boolean] loop=true)

Starts animation playback (provided it was stopped earlier with ModelRenderer:StopAnimationPlayback) or changes the way an animation plays back. Pass false to disable looping.



Stops animation playback.


ModelRenderer:SetAnimationTime( [number] time )

Sets the current animation time (in seconds).

You could call ModelRenderer:StopAnimationPlayback and then use this function to move forward / backward in time in a script.

Model animations are rendered at 30 frames per second. This means you can skip to the 3rd frame on an animation by using ModelRenderer:SetAnimationTime( 3 / 30 ) for instance.


[boolean] ModelRenderer:IsAnimationPlaying()

Returns true if an animation is currently playing.

ModelRenderer:GetModel, ModelRenderer:SetModelEdit

[Model] ModelRenderer:GetModel()
ModelRenderer:SetModel( [Model] model to display, [boolean] clear animation=true )

Gets or sets the displayed model. You can get a model to display with CraftStudio.FindAsset.

ModelRenderer:GetOpacity, ModelRenderer:SetOpacityEdit

[number] ModelRenderer:GetOpacity()
ModelRenderer:SetOpacity( [number] opacity )

Gets or sets the model renderer's opacity (between 0.0 and 1.0)


[table] ModelRenderer:GetBlockTransform( [string] block name )

Returns a table with position and orientation keys containing the specified model block's current position and orientation ( "[table].position" and "[table].orientation").

This method is useful for making a weapon or tool follow an arm for instance.