J
Joe Banko
Guest
I have an object, hitbox and another object, o_enemy_parent. I want to detect a collision between the 2 object using the following code:
with(o_enemy_parent) {
var dto = distance_to_object(other);
if dto < 100 {
var pm = place_meeting(x, y, other)
if pm {
...
...
I register a collision and setting breakpoints at "if dto" and "if pm". for dto I get a value of ~31 but I get a value of false for pm. Why am I not getting a true for pm? The x, y values of o_enemy_parent (.Self) are 644, 415 and the x, y of other are 777, 415. It would seem that to get a true for pm I would have to add 100 to x and y in place_meeting but that doesn't work either. I'm totally baffled by this code which I used in another tutorial application and it worked fine there. I'm seriously missing something but not sure what it is.
TIA,
joeb
with(o_enemy_parent) {
var dto = distance_to_object(other);
if dto < 100 {
var pm = place_meeting(x, y, other)
if pm {
...
...
I register a collision and setting breakpoints at "if dto" and "if pm". for dto I get a value of ~31 but I get a value of false for pm. Why am I not getting a true for pm? The x, y values of o_enemy_parent (.Self) are 644, 415 and the x, y of other are 777, 415. It would seem that to get a true for pm I would have to add 100 to x and y in place_meeting but that doesn't work either. I'm totally baffled by this code which I used in another tutorial application and it worked fine there. I'm seriously missing something but not sure what it is.
TIA,
joeb