How to make objects of the same group interact with each other?


#1

I have a few objects in the group ‘element’. These elements have variable ‘id’ to identify between them. How do I check if one object is inside another object ?

I used the following code but it always returns true.


#2

@krishnakumarm777 Regarding the object groups, we found with Moderator Bouh on discord that there’s a bug that always makes any condition that uses object groups, to return true.

So far object groups have only worked for me when using actions (like moving them all at the same time via forces) but conditions don’t seem to work right now.

Apart from that since you’re using a for each loop event but that event should only work on object instances of a particular object that are already present in the stage, not with the content of object groups themselves (unless this is also a by-product of the aforementioned bug :thinking: ).

Either way as far as I know there is no existing condition or action that let’s you sort objects inside a group, much less manipulate them individually, so you might have to try a different solution that does not involve groups for now, meanwhile the bug is reported and fixed by the developers :pensive:


#3

Here the issue is detection inside same object, i’ve same issue with raycast…

For each on group working like i do (see my screenshoot)
Your implementations is wrong, you check “if your object have a id variable with its own variable”.
(It’s the snake that eats its tail)

Your last line is wrong too, you check if point center of your object is inside your object, so it’s always true.
(It’s the snake that eats its tail again)

In your case the current instance in loop should be removed or not take in count, but only in the next condition. But we can’t say to engine remove this instance in particular.

Maybe by assigning a unique value to the current instance.
And by checking the value in the sub event but not sure…

If you use two different objects it’s working fine like this:
One group called myGroup with object1 inside
A other object called NewObject.

Multiple instance of object1 on scene, some with id (instance variable) set to 1, and other to 0.
One instance or multiple of NewObject, it’s same for one or more.