My follow enemy works really well (well enough for me to leave alone for my purposes) but, whenever it walks off an edge or jumps, it falls slow. Like its in slow motion or something. The player character has a normal fall speed but for the follow slime its significantly slower. The issue is not huge but just annoying as I cant explain it at all and its a bit jarring compared to our own fall speed. I would understand if it was just when his jump is triggered and something is making it glitch out in the code but it even happens when only his velocity is working and he just moves off a block.
Here’s a pic of the enemy’s code
Link to the testing game:
https://flowlab.io/game/play/1615759
Its level 1 and just the blue slime’s behavior. Let me know if theres a fix and if theres something messed up in my code! I looked over it while it was running and paused during the slow fall but cant find anything running that would cause something like this.
1 Like
I remember this glitch, I forget how I fixed it 
I do know you can create artificial gravity with relative ease. (@rcreger)
2 Likes
Oh snap
If its a glitch i can work with it being a little weird. For my idea I don’t think I need jumping so I can just remove that part of the behavior for now and work with the walking. Thanks for letting me know 
1 Like
Yeah, my enemies have the same issue with artificial gravity, but has normal gravity when jumping and stuff. My guess would be, for a non-artificial gravity game, is that when the moving object is COMPLETELY off a ground piece, turn off the movement entirely until back on the ground.
The reason why I say ‘completely’ with emphasis is that I don’t want you to have an issue of the moving object stopping while only half way off. So make several raycasts (easiest is 3 different ones: a straight down trigger one, and one angled left and right to make sure both sides are off the ground). It will take some tinkering, though. Perhaps you could also lower the speed while in air, it may help.
This is the only things I can come up with without testing. So good luck, and let me know of the findings!
4 Likes
I will definitely try that out! Might take me a while (Currently working on a project) but ill let you know how it goes! I was thinking it probably had to do with movement still being enabled while the jump was In progress but I only tested it with one ray cast straight down and it didn’t work, so I’ll definitely try with 3 when I get the chance 
1 Like
Okay, tested it out - this works. But there’s a few issues. It will sometimes trigger the jump when falling, so extracting the y velocity and making sure that if it is falling then the jump cannot trigger.
Second, when the enemy jumps, have it so it has an impulse going in the direction of the player, because having this stop movement will prevent it to jump towards the player with ease.
I think that should do, if you have questions, let me know:) and this is with still using only one raycast btw
3 Likes
I think I can code that! But if I run into any further issues i’ll let you know, thanks so much. Ive tinkered with this code a lot so I don’t mind going the extra mile to smooth out the bumps so I can have a better enemy behavior 
2 Likes
Sounds good, and good luck! 
3 Likes
Oh, I remember! Don’t do always on the velocity, go once or a timer.
2 Likes