2d_warrior
Member
I'm trying to loop through to find how many collisions with Tree_obj I'm getting in the player's collision rectangle (actually place_meeting), and also get the id each loop. I'm only getting the value 0 for each when I don't overlap the object (that part's correct), and 1 for each variable when I do. What am I doing wrong here? I should get an instance id value (a long number), and more than 1 when I overlap multiple instances of Tree_obj, but all values are 1 right now.
Script:
obj_id=0
obj_collision_count=0
//check repeatedly for all obj2s at are at these coordinates
with
(
object_index==Tree_obj and place_meeting(x,y,Tree_obj)
)
{
//set obj_id to colliding instance add obj_col_count if collision
other.tube_id=place_meeting(x,y,Tree_obj)
if other.obj_id!=0
{
other.obj_col_count+=1
}
}
//repeats process until number of collisions with Tree_obj is found
Script:
obj_id=0
obj_collision_count=0
//check repeatedly for all obj2s at are at these coordinates
with
(
object_index==Tree_obj and place_meeting(x,y,Tree_obj)
)
{
//set obj_id to colliding instance add obj_col_count if collision
other.tube_id=place_meeting(x,y,Tree_obj)
if other.obj_id!=0
{
other.obj_col_count+=1
}
}
//repeats process until number of collisions with Tree_obj is found