You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempted to reproduce in v3.5.3.stable.mono.official but not confident I could create an equivalent example, however in what I did attempt the feature still did not work.
System information
Windows 10
Issue description
When attempting to create an animation entirely in GDScript using an existing image, the texture cannot be animated. Attempting to animate the texture appears to cause the Sprite2D to have no texture, being invisible upon debugging.
Steps to reproduce
Create a Node2D node
Add a Sprite2D child node, and assign it a texture using the Inspector GUI
Set up an animation on the Node2D node to change the texture of the Sprite2D node similar to the provided sample script below
extendsNode2D# Create the animation player and library@onreadyvaranimation_player:=AnimationPlayer.new()
@onreadyvaranimation_library:=AnimationLibrary.new()
# Called when the node enters the scene tree for the first time.func_ready():
# Add the animation player as a child of the nodeadd_child(animation_player)
# Load the new icon texturevartexture: Texture2D=load("res://new_icon.svg")
# Declare a new animationvarnew_animation=Animation.new()
# Declare the animation trackvartexture_track=new_animation.add_track(Animation.TYPE_VALUE)
# Set the track path to target the Sprite2D's texture propertynew_animation.track_set_path(texture_track, "Sprite2D:texture")
# Insert a key to change the texture to the new iconnew_animation.track_insert_key(texture_track, 0, texture)
# Add the animation to the libraryanimation_library.add_animation("change_texture", new_animation)
# Add the library to the animation playeranimation_player.add_animation_library("", animation_library)
# Called every frame. 'delta' is the elapsed time since the previous frame.func_process(_delta):
# Play the animationanimation_player.play("change_texture")
I guess it could be that for some reason the type determination fails and the value key type is determined to be Nil, causing the interpolation to fail, but I'd have to look into the details.
Tested versions
Reproducible in v4.2.1.stable.official.b09f793f5
Attempted to reproduce in v3.5.3.stable.mono.official but not confident I could create an equivalent example, however in what I did attempt the feature still did not work.
System information
Windows 10
Issue description
When attempting to create an animation entirely in GDScript using an existing image, the texture cannot be animated. Attempting to animate the texture appears to cause the Sprite2D to have no texture, being invisible upon debugging.
Steps to reproduce
Minimal reproduction project (MRP)
GDScriptTextureAnimation.zip
The text was updated successfully, but these errors were encountered: