Not sure if this is a bug, or my inexperience - Collisions not responding as expected

Hi there. I’m new here, and this is my first flowlab game in progress. It still has a long way to go, but I’m getting tripped up on something most of you experts will spot right away.

I have an enemy named Varroa that is supposed to run back and forth, left to right. When it hits an obstacle, like a flower or a block, it’s supposed to flip and go the other way. I set this up with collision, flip, number and velocity blocks. When I clone the varroa mite and place it in other locations, the behavior wasn’t working. I figured, ok, maybe the “dirt” block I cloned around the game needed to be called by it’s object name, so I tried putting that in directly. That didn’t work. I also made sure that the collision block had Dirt and Any Object listed, but that didn’t work, either. Can someone take a look and see if they can figure out what I’m doing wrong? I realize it’s messy in there and I could be more efficient about my flows, but the behavior bundle creation wasn’t working for me, so please avert your eyes from the mess.

Thanks for any help!
http://flowlab.io/game/view/1357627

collision should be connected to toggle

Yeah, I forgot to mention that that didn’t work. I must have switched it to flip to troubleshoot. Even when it’s on toggle it won’t work.

make the collision to only left and right

uZe uR sMaRTz ;3

Is the problem that its not flipping or that its spazzing out on a wall?
Far as I can tell, they are flipping but they get stuck.

Before I show the fix, please note this “Resource” is very jank with its hitbox.
Make this a square and this fix will work better.
Its best for all the Flowers to be a square but this is the only one that kept messing up.
2020.02.26-17.55

Using a collision set to any should work if you set the repeat delay to 3.
But as you can see here, the back top 3 Varroa’s get stuck on the right as if off screen objects doesnt see the collision.
2020.02.26-17.43

V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V
My work around is a bit more complex but works for all Varroa’s.
I’ll leave a details of the behavior below this image;
2020.02.26-17.42

Raycast 1:
Any Type
Angle: 0
Length: 16

Raycast 2:
Any Type
Angle: 180
Length: 16

Timer:
Delay: 3
Repeat: 1

Hey @MrsBrune - just to clarify the root issue a little bit, what is happening here is that when an object moving in one direction contacts another object, and you flip it to change direction, it still might be touching that same object in the next frame when the collisions are evaluated again. If this happens, then the logic will trigger the Flip again, and the object is “stuck” at that point as the logic just keeps toggling back and forth every frame.

@“JR 01” mentioned a few potential fixes for this case, such as turning up the delay a bit on the collision trigger, so that it won’t immediately trigger again.

Another possible option is turning up the “bounce” setting on the objects that are colliding so that they don’t stay touching for more than a single frame when they collide.

A third and probably even more reliable option is to use the Raycast logic suggested above