FANDOM


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:StartAnimationPlaybackEdit

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.

ModelRenderer:StopAnimationPlaybackEdit

ModelRenderer:StopAnimationPlayback()

Stops animation playback.

ModelRenderer:SetAnimationTimeEdit

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.

ModelRenderer:IsAnimationPlayingEdit

[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)

ModelRenderer:GetBlockTransformEdit

[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.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.