Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Railguns fired vertically downwards lose helix animations. #17278

GraionDilach opened this issue Oct 26, 2019 · 0 comments


Copy link

@GraionDilach GraionDilach commented Oct 26, 2019

LeftVector = new WVec(ForwardStep.Y, -ForwardStep.X, 0);
if (LeftVector.LengthSquared != 0)
LeftVector = 1024 * LeftVector / LeftVector.Length;
// Vector that is pointing upwards from the ground
UpVector = new WVec(
-ForwardStep.X * ForwardStep.Z,
-ForwardStep.Z * ForwardStep.Y,
ForwardStep.X * ForwardStep.X + ForwardStep.Y * ForwardStep.Y);
if (UpVector.LengthSquared != 0)
UpVector = 1024 * UpVector / UpVector.Length;

If the railgun is fired vertically downwards, then the distance will be a (0, 0, dist) which will turn both LeftVector and UpVector to 0. UpVector should probably check if LeftVector's length is 0 and if that's the case, just go with (direction.Z, direction.Z, 0) probably (my vector math is failing here, so Y might be 0).

@abcdefg30 abcdefg30 added the Bug label Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.