texture only loads in a little

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Axolotiee

this is my current function, im trying to make the player teleport and then change the texture. when I use this function it only loads some of the new texture in but not all of it.

func _process(delta):

if Input.is_action_just_pressed("leftclick"):
	$Sprite.texture = load("res://Images/icon.png")
	self.position = get_parent().get_node("Position2D").position


  • what about using a sprite sheet and then just change the current frame of the sprite?

  • have you tried to load the texture in the ready function and then just assign it when needed?

juppi | 2022-02-27 10:42

Maybe you changed the sub-region properties of your Sprite, but the new texture has a different size, which is why it shows only some of it? (I assume that’s the problem when you say “but not all of it”?)

Zylann | 2022-03-02 13:46