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!
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
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.
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.
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;
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