Godot - Change the texture of a sprite
GDScript to change texture.
To change Texture set on Sprite2D node etc, change "texture" property.
var sprite = get_node("Sprite")
var new_texture = preload('res://texture.png')
sprite.texture = new_texture
For sprite sheet with frame split, specify target position in "frame" property.
var new_texture = preload('res://texture.png')
texture = new_texture
frame = 6