V
viniciuscsg
Guest
After reading the documentation on collision methods I couldn't find a complete solution for this situation: I have an object 1 with a create instance action at its create event. That action creates an instance of an object 2. Then I need to make a collision event (or check for collisions in code) that will trigger only when object 1 collides with the that specific instance which was created in the create event.
If I set up a simple collision event and select object 2 as target it will register collisions of object 1 with any instance of object 2, but that is a problem because there is a bunch of those in the room, since each instance of object 1 spawns its own copy of object 2 ( the game works like that if all objects are static and there is no chance of they touching each other, but wont work as intended if they move and collide).
I suppose I need to check for the instance ID when creating it, and store it in a variable by defining it = to the argument that creates the instance. But then, what would be the syntax to check for collisions with it using any of the collision functions that have an obj as parameter? I cant find that anywhere in the manual. Is it possible to instead simply use the collision event and make it to trigger only when touching that specific instance of object 2 created by the object 1?
Does anyone knows how would I go about doing that? Thank you in advance!
If I set up a simple collision event and select object 2 as target it will register collisions of object 1 with any instance of object 2, but that is a problem because there is a bunch of those in the room, since each instance of object 1 spawns its own copy of object 2 ( the game works like that if all objects are static and there is no chance of they touching each other, but wont work as intended if they move and collide).
I suppose I need to check for the instance ID when creating it, and store it in a variable by defining it = to the argument that creates the instance. But then, what would be the syntax to check for collisions with it using any of the collision functions that have an obj as parameter? I cant find that anywhere in the manual. Is it possible to instead simply use the collision event and make it to trigger only when touching that specific instance of object 2 created by the object 1?
Does anyone knows how would I go about doing that? Thank you in advance!