Objects spinning after collision ends

(Sorry if this is the wrong category or too detailed, I’ve never posted before)
I’m making a sort of ecosystem simulator where there are creatures that move in random directions and change directions after a random period of time, until they collide with a target object (such as food or a mate) which they will follow/move into until they change target. For some reason, after they collide with any object, they move in circles until they get a new random direction. This is causing them to starve to death.
I’m pretty sure this is because they have rotation enabled, because it’s not shown in their code, and I didn’t see it when I tested the game with it disabled, but I’d rather not have it disabled because it looks really bad, and the creatures either get stuck facing each other until they change direction or barely face targets.
I’m not sure why this is happening, because they move in circles when they aren’t currently colliding with anything, but only after colliding with things. Is this a bug on flowlab’s end or an issue with my code?
The rotational code is just a timer that gets a random number from -360 to 360 which it adds to the rotation, and then randomizes the timer length and starts again. In the case of target following, it just has a point at with the target’s position. it works just fine other than the circling.
Sorry if this makes no sense.
image
The thick curved path is when the creature was pushing another creature, so that makes sense, but the dotted one didn’t have them colliding with anything.
Game in question: Flowlab Game Creator - Environment

1 Like


… this code is so messy!

I really have no idea what is causing this problem.

man I thought it was actually pretty neat lol

Use bundles to separate peices of code to make it look more organised

I’m aware of bundles, I just tend not to use them because my code ends up as webs where basically everything is connected.

1 Like

Use messages to split the webs up?