if place_meeting() *solved*

Kyon

Member
Heya,
so let's say I'm using:
Code:
if place_meeting(x+1,y,object)
And I want something to happen to that specific object he is meeting with, how do I do that?
Like, I want it to behave as
Code:
other
so like:

Code:
if place_meeting(x+1,y,object){
other.variable=true;
}



Kyon.
 

Simon Gust

Member
You need to use the equivalent function that returns the id of the hit instance instead of just a confirmation that something has been hit, namely instance_place() using the same arguments as place meeting.
Code:
var inst = instance_place(x+1, y, object) 
if (inst != noone) {
   inst.variable = true;
}
In this scenario, the created variable "inst" either holds the id of the hit object or the keyword "noone" (-4) if no collision occurred.
 

Kyon

Member
You need to use the equivalent function that returns the id of the hit instance instead of just a confirmation that something has been hit, namely instance_place() using the same arguments as place meeting.
Code:
var inst = instance_place(x+1, y, object)
if (inst != noone) {
   inst.variable = true;
}
In this scenario, the created variable "inst" either holds the id of the hit object or the keyword "noone" (-4) if no collision occurred.
Thanks!
Exactly what I was looking for.
 
Top