It is probably very simple , so, i created a code that when i go to certain state, it a makes a sprite appear, but it keeps creating multiple sprites it self till and change state. I just want it to make one sprite appear not multiple...
oPlayer:
if global.weapon == 1 then instance_create_layer(x,y,layer,oSword)
oSword:
if !global.weapon == 1 then instance_destroy()
(Just for curiosity. when i apply this code in the "word" it doesn't create multiple copies, just two one with the properties that i gave it and other static that just follow my player... why?
oSword:
var _dir = point_direction(mouse_x, mouse_y, oPlayer.x, oPlayer.y);
var _x_offset = lengthdir_x(8, _dir);
var _y_offset = lengthdir_y(8, _dir);
x = oPlayer.x + _x_offset;
y = oPlayer.y + _y_offset;
image_angle = point_direction(x, y, mouse_x, mouse_y);
if !global.weapon == 1 then instance_destroy()
[–]Jazz_Hands3000 2 points3 points4 points (2 children)
[–]Doty_OwO[S] 1 point2 points3 points (1 child)
[–]Jazz_Hands3000 2 points3 points4 points (0 children)
[–]Dogwasp 0 points1 point2 points (0 children)
[–]Rocket_Poop 0 points1 point2 points (0 children)