I have an issue with collision checking of circle instances, actually it just doesn't work and collide_object=noone in any case, also importatnt thing is that i don't know why but x always= chobj.x
Important thing:Object doing this script is also a child of Pobj_circle
So this is my GMS 2 script to check for collision between two circle instances:
///@desc CheckForCCollision
for(var t=0;t<instance_number(all);t++)
{
if(t==0) var list=ds_list_create();
var iobj=instance_find(Pobj_circle,t); !!!!!!!!! Actually I think problem is here or down below <------
inst[t]=iobj;
ds_list_add(list,inst[t]);
}
for(var u=0;u<ds_list_size(list);u++)
{
var chobj=ds_list_find_value(list,u)//Object we are checking now
//Include Dynamic-Dynamic Collision
//Make One Circle Stationary (V1-V2) creating new Velocity vector
var scriptV_length=point_distance(chobj.Vx,chobj.Vy,Vx,Vy);
var scriptV_direction=point_direction(chobj.Vx,chobj.Vy,Vx,Vy);
// Early Escape test: if the length of the movevec is less
// than distance between the centers of these circles minus
// their radii, there's no way they can hit.
var dist=point_distance(x,y,chobj.x,chobj.y) !!!!!! Using debugger I found that even When i Have checked Object as a different from checking object it's X and Y coordinates still don't change and have x=chobj.x
when chobj is not the same as the object doing this script; <-------
var R_Sum=R+chobj.R;
if(scriptV_length<(dist-R_Sum)) collide_with=noone;
............
..................
................
}
Important thing:Object doing this script is also a child of Pobj_circle
So this is my GMS 2 script to check for collision between two circle instances:
///@desc CheckForCCollision
for(var t=0;t<instance_number(all);t++)
{
if(t==0) var list=ds_list_create();
var iobj=instance_find(Pobj_circle,t); !!!!!!!!! Actually I think problem is here or down below <------
inst[t]=iobj;
ds_list_add(list,inst[t]);
}
for(var u=0;u<ds_list_size(list);u++)
{
var chobj=ds_list_find_value(list,u)//Object we are checking now
//Include Dynamic-Dynamic Collision
//Make One Circle Stationary (V1-V2) creating new Velocity vector
var scriptV_length=point_distance(chobj.Vx,chobj.Vy,Vx,Vy);
var scriptV_direction=point_direction(chobj.Vx,chobj.Vy,Vx,Vy);
// Early Escape test: if the length of the movevec is less
// than distance between the centers of these circles minus
// their radii, there's no way they can hit.
var dist=point_distance(x,y,chobj.x,chobj.y) !!!!!! Using debugger I found that even When i Have checked Object as a different from checking object it's X and Y coordinates still don't change and have x=chobj.x
when chobj is not the same as the object doing this script; <-------
var R_Sum=R+chobj.R;
if(scriptV_length<(dist-R_Sum)) collide_with=noone;
............
..................
................
}