#how to completely swap sprites godot

6 messages · Page 1 of 1 (latest)

gilded geyser
#

So basically i'm working on a top down, endless survival game were enemies infinetly spawn, the thing is in the man script their being instanced and their x and y position are being set once that happen they follow the player. I want their to be 3 different enemies so how would i made 3 diffrent sprites 2d how would i set a sprite to be the one? (2d, using gdscript)
thanks

#

or if that is a bad approach how would i switch the image in the sprite?

wild matrix
#

if u like u can instead make 3 different enemy scenes
select a random one from the enemy scenes
then instance it.

this approach can allow you to have multiple enemies with modifiable elements instead of 3 different image with the same elements

#

but if u really want it that way
i guess u can do it this waytexture = preload("res://Assets/characters_packed.png")

#

change the resource to what u have ofcourse

gilded geyser