#after i think
1 messages · Page 1 of 1 (latest)
could be that the collision happens between the time the bigger cube created and the merged ones removed
try to remove them before you create a bigger one
alright i modified the code to do that
hmm it still does the weird thing
oh right the parent ill try with no direct parent
btw, you also need to take account that destroying gameobject happens on the end of the current frame.
But I think you can just simply disabling colliders on the little one before creating the bigger cube
even with no set parent it does the same thing
i'll try disabling colliders
destroying gameobject happens on the end of the current frame.
regardless of order?
disabling the colliders still doesn't work
if you watch the second video more closely, its like the extra cube gets pulled in somehow
🤔 try adding debug.log before creating a cube, also add the cube size to the log
and check the who is creating the big cube
So you can know who is creating that big cube
interestingly, i only printed collision.gameObject and currentCube
there were 3 objects involved that i placed
how do you check the collision? using ontrigger?
void OnCollisionEnter(Collision collision) {
wait, where do you put oncollisionenter?
on the transparent cube that you can move around?
no
the function is on all the different cubes
the transparent cube is just a cursor representation and holds no weight/force
all cubes except transparent will have this added onto them
however this is added after the name change
-# the name change was required for one of the if statements
my guess is that the size 1 cube collides with the small cubes when it was created. try assigning the newcube to different layer, just to make sure