Skip to content

WeaponManager attack raycast layer mask collides with objects on the "Ignore Raycasts" layer #2767

@RedRoryOTheGlen

Description

@RedRoryOTheGlen

As per the title, the Layer Mask variable of the WeaponManager class only excludes the "Player" layer. This is how it is initialized in WeaponManager.
Image

Copying the layer mask to a public variable to view in the Inspector:
Image

This results in objects on the "Ignore Raycast" layer (like corpses and lootpiles) to "block" the attack spherecast. The corpses aren't considered doors or static colliders, so the backup raycast never fires. This makes hitting enemies while fighting around corpses unreliable as you get no feedback on whether the attack just missed or it hit a corpse and vanished. Especially noticeable with small enemies like rats, but can also be problematic with the camera level due to the size of the spherecast.

Image

Theoretically, this can also mean that the automap marker models can block attacks, though I have not tried this yet.

SOLUTION:
Simply removing "Ignore Raycast" (and maybe "Automap" as well) from the included layers in the Layer Mask would fix this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions