If Statement to choose Shortest Route Incomplete

Hi everyone, so after going through this video I noticed an issue with my tank in-game.

Moving right-to-left across the 180* mark works just fine and the barrel correctly chooses the shortest path to rotate.
Moving left-to-right across the 180* mark DOESN’T work as the if statement is incomplete.

I anded a check for greater than negative 180 like this:
((DeltaRotator.Yaw <= 180) && (DeltaRotator.Yaw >= -180))

After rewatching the video I think this left-to-right issue is visible there.

Thanks.

This has been noted and check here for @ben’s solution:

Thanks Kyle I’m going to make a patch to the video now to give people a heads up. We will solve this issue in the next couple of videos

Why just don’t take DeltaRorator.GetNormalized().Yaw? It looks like proper solution, unless I’ve missed some side-effects…

Both should be fine as they should achieve the same thing.

Privacy & Terms