I implemented a drift feature for my game.
It works fine for the player but doesn’t work properly for the bot.
The bot moves backwards. It usually occurs when facing right. Not always.
The drift works by using a tween to tween, a variable used for angle of force.
Tween is from current value to current bot angle
GIF, Showcasing of the problem
Detailed snippet of the events
I collapsed events of which I think are unrelated.
I also made a comment above some events to explain their purpose and how they work
If you want to see other events or know the purpose of something, ask me here.
I don’t think anyone cares to load the project, and that’s fine.
If you want to try the bug by yourself, ask me here and ill share a playable version/zipped version of this game.
Tweens should be actioned once and let to run. You’re repeatedly starting a new tween. I’d suggest adding a condition to check the tween isn’t running before actioning the tween.
First, it doesn’t give satisfactory results.
Two, I’ll need to adapt to lerpAngle
What I think the problem is that Tween isn’t optimized for angle instead it just thinks that this is a number variable because I literally just Tween a number variable and so it isn’t treated as an angle
Maybe because the AI has more of ‘robotic’ movement
You could, but I don’t have the time at present to delve in other’s issues, though others might.
You could isolate the feature by creating a small project just with that AI drift control and see if you can make that work, and then move that into the main game.