T
TyGamess
Guest
If it seems like I post here a lot it’s because I can’t find the answer in the rest of the feed. I looked up “Crafting” before but they all had Questions on how to improve already Existing code.
Basicly saying is I need help and I didn’t find the answer. So I have a parent Object for a set of objects that are called item. I only have 2 at the moment: obj_itemA and obj_itemB, the parent being obj_itemParent. I would like to know how I would make a step check for when these two (item a and b) are colliding with each other but rather then adding 2 long strings of collision checks in both items (and all the others to come) just putting the code in the parent
Simply put after they are colliding if the play it’s the C button they both are distorted and a new object is created, that part I know how to do.
When I use the code:
this works, sorta. You see when I hit C, they automatically delete and create without them being collided with each other, on top of that if I hit C again, it crafts itemC without needing itemA or itemB, I’m starting to get a little Frustrated so I need some help.
Basicly saying is I need help and I didn’t find the answer. So I have a parent Object for a set of objects that are called item. I only have 2 at the moment: obj_itemA and obj_itemB, the parent being obj_itemParent. I would like to know how I would make a step check for when these two (item a and b) are colliding with each other but rather then adding 2 long strings of collision checks in both items (and all the others to come) just putting the code in the parent
Simply put after they are colliding if the play it’s the C button they both are distorted and a new object is created, that part I know how to do.
When I use the code:
GML:
if obj_itemA place_meeting(x,y,obj_itemB) {
keyboard_check_pressed(ord("C")) {
instance_destroy(near_itemA)
instance_destroy(near_itemB)
instance_create(x,y,"Items",obj_itemC)
}
}