Transform shaking

I have an object with a raycast coming from the front. The object will go forward and when the raycast hits a wall. It will active the turn function to avoid colliding with the wall. Once the raycast is no longer hitting the wall, the object will move forward.

But when the raycast hit a wall. The object jitters back and forth while rotating. What is happening?

Could it be something to do with this? LINKS!

No I doubt this has anything to do with scale. I think it has to do with checking and activation a function frame at a time… or is it second at a time? I don’t know… This problem doesn’t happen with this code…

Here is the project file. It has cubes bouncing around.

412040–14277–$SpaceShooterD3.7z (112 KB)

My bad yall. Obviously this should be behaving badly… I keep overlooking the obvious. I’m going to have to remove that negative value and see how it goes when I get back. ugh!

moveDirection = Vector3(0,0,40);
moveDirection = Vector3(0,0,-40);