AnimatedSprite3D

Inherits: SpriteBase3D < GeometryInstance3D < VisualInstance3D < Node3D < Node < Object

2D sprite node in 3D world, that can use multiple 2D textures for animation.

Description

Animations are created using a SpriteFrames resource, which can be configured in the editor via the SpriteFrames panel.

Tutorials

Properties

StringName

animation

&"default"

int

frame

0

SpriteFrames

frames

bool

playing

false

float

speed_scale

1.0

Methods

void

play ( StringName anim=&"", bool backwards=false )

void

stop ( )

Signals

  • animation_finished ( )

Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn.


  • frame_changed ( )

Emitted when frame changed.

Property Descriptions

Default

&"default"

Setter

set_animation(value)

Getter

get_animation()

The current animation from the frames resource. If this value changes, the frame counter is reset.


Default

0

Setter

set_frame(value)

Getter

get_frame()

The displayed animation frame's index.


Setter

set_sprite_frames(value)

Getter

get_sprite_frames()

The SpriteFrames resource containing the animation(s).


Default

false

Setter

set_playing(value)

Getter

is_playing()

If true, the animation is currently playing.


Default

1.0

Setter

set_speed_scale(value)

Getter

get_speed_scale()

The animation speed is multiplied by this value.

Method Descriptions

Plays the animation named anim. If no anim is provided, the current animation is played. If backwards is true, the animation will be played in reverse.


  • void stop ( )

Stops the current animation (does not reset the frame counter).