Dan1
Member
Hey everyone,
So I'm making an option where, if the object detects a collision with a different object (based on its ID), it will react when a trigger is set, but the collision_rectangle code is not working as I thought it would.
At the moment, I have this:
The trigger loads the specific object's ID into the variable global.idremove but when I test the trigger, ALL of the objects checking for this collision react, not the ones within the confines of the collision with this particular object who's ID has been loaded in to the variable.
Any suggestions why this isn't working?
Much appreciated!
- Dan
So I'm making an option where, if the object detects a collision with a different object (based on its ID), it will react when a trigger is set, but the collision_rectangle code is not working as I thought it would.
At the moment, I have this:
Code:
if collision_rectangle(global.idremove.x-sprite_get_xoffset(global.idremove.sprite_index)+5,
global.idremove.y-sprite_get_yoffset(global.idremove.sprite_index)+5,
global.idremove.x-5+sprite_get_width(global.idremove.sprite_index)-sprite_get_xoffset(global.idremove.sprite_index),
global.idremove.y-5+sprite_get_height(global.idremove.sprite_index)-sprite_get_yoffset(global.idremove.sprite_index),
global.idremove.object_index,true,false) then { ... }
Any suggestions why this isn't working?
Much appreciated!
- Dan