Weird "Look rotation viewing vector is zero" error after new rust updateSuggestion

i tracked this error to this plugin and made a fix, works for my server..

public Quaternion GetRotation(string shortname)
{
    if (shortname == "ladder.wooden.wall")
    {
        Vector3 normal = hit.normal;
        if (normal == Vector3.zero || normal.sqrMagnitude < 0.0001f)
            normal = Vector3.up;
        return Quaternion.LookRotation(normal);
    }

    if (hit.point == default || t == null)
        return Quaternion.identity; // Fallback

    Vector3 direction = (t.position - hit.point).WithY(0f);

    if (direction.sqrMagnitude < 0.0001f)
    {
        direction = player.eyes.BodyForward().WithY(0f);
        if (direction.sqrMagnitude < 0.0001f)
            direction = Vector3.forward;
    }

    return Quaternion.LookRotation(direction.normalized, player.serverInput.AimAngle() * Vector3.up);
}​

this fixed the error, the code might not be the best and should reviewed

does not completely fix the problem, but reduced the error spam

You've successfully pasted the structure
[RaidableBases] 2x2x2_a @ D15 : 30 items
You've successfully pasted the structure
[RaidableBases] 2x2x2_d @ K14 : 30 items
You've successfully pasted the structure
[RaidableBases] Hex_c @ I8 : 30 items
You've successfully pasted the structure
[RaidableBases] 2x1_c @ D8 : 30 items
You've successfully pasted the structure
[RaidableBases] 2x1_e @ O18 : 30 items
Look rotation viewing vector is zero
You've successfully pasted the structure
[RaidableBases] Hex_g @ D5 : 30 items
You've successfully pasted the structure
[RaidableBases] 2x2x2_r @ P2 : 30 items
[RaidableBases] Next automated raid in 00h 36m 29s at 06/07/2026 13:31:09
Invalid Position: chicken.corpse[1709876] (514.38, -500.55, -678.27) (destroying)

heya, thanks, but that spam is after the base pastes.

your method is for when a player tries to deploy a ladder or a barricade in a no-build area. there's another method for the high external walls. 

try this, but if the spam is from high external walls (which should never be zero) or something else then it won't make a difference what you change here as it would use a different method.

            public Quaternion GetRotation(string shortname)
            {
                var dir = shortname == "ladder.wooden.wall" ? hit.normal : (t.position - hit.point).XZ3D();
                return dir.sqrMagnitude <= 0.0001f ? t.rotation : Quaternion.LookRotation(dir.normalized);
            }​

Awesome I'll check it.. I actually have walls turned off but I'll use your fix and report back

Merged post

This definitely fixed it, thank you 

Merged post

Uh geez... So right after I applied your patch facepunch pushed a server update and it started again

ya, it's not related to ladders then. try disabling arena walls in the profiles and let me know if it stops for good this time. those shouldn't be zero though