Rexzqy
Member
Hi,
So I want to clear all tiles on a tilemap.
This is in the create event of the object that puts tiles on the map:
This is in the step event:
However it is not working and the tiles are still there. Any help is greatly appreciated!
EDIT: I am such a idiot, I forgot to put the stuff in create event. Fixed it now
So I want to clear all tiles on a tilemap.
This is in the create event of the object that puts tiles on the map:
GML:
global.ground_tilemap_wood =layer_tilemap_create("Instances",0,0,ti_mud,room_width,room_height);
for (i =0;i<105;i+=1)
{
for (j=0;j<=130;j+=1)
{
if position_meeting(i*100,j*100,obj_wall_no_ground_spawn) = false
{
var ran_data=irandom_range(1,100);
tilemap_set_at_pixel(global.ground_tilemap_wood,ran_data,100*i,100*j)
}
}
}
Code:
if season != obj_daycycle.season
{
tilemap_clear(global.ground_tilemap_wood,0);
layer_tilemap_destroy(global.ground_tilemap_wood);
season = obj_daycycle.season;
}
EDIT: I am such a idiot, I forgot to put the stuff in create event. Fixed it now
Last edited: