M
Malico
Guest
Hey there, I'm trying to get a collision from a bullet to set code on the object it collides with to trigger a smash portion of code.
The collision check runs and destroys the bullet, but the smash variable is not updated on the target. (crate is temporary target for testing)
Seems the other constant is not recognised even during the collision.
Any ideas?
Much appreciated.
Code from Bullet Step:
Code to trigger on obj_crate:
The collision check runs and destroys the bullet, but the smash variable is not updated on the target. (crate is temporary target for testing)
Seems the other constant is not recognised even during the collision.
Any ideas?
Much appreciated.
Code from Bullet Step:
GML:
if place_meeting(self.x,self.y,obj_crate) // Hit target
{
other.smash = 1;
other.hit_dir = direction + irandom_range(-10,10);
other.hit_spd = speed+irandom_range(1,5);
instance_destroy(); // This works (bullet destroys)
}
GML:
if smash = 1
{
part_1 = instance_create_depth(self.x,self.y,8,obj_crate_smash_1);
part_1.direction = hit_dir;
part_1.speed = hit_spd;
instance_destroy();
}