Material Box

Material Box

WEB Design & Material Images

Godot - Change the texture of a sprite

Godot

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

Godot

TitleGodot - Change the texture of a sprite

CategoryGodot

Created

Update

AuthorYousuke.U