Skip to main content
Bumped by Community user
Bumped by Community user
added 46 characters in body
Source Link
  • I have a LineRenderer that ignores certain Layers based on a Raycast using LayerMask.

  • I have a cube with a collider on a Layer which is ignored because of the LayerMask.

  • I have a smaller object inside the cube that is a child object of the cube and is on a layer that is notnot set to be ignored. I need the Raycast to hit the smaller object.

When this smaller object is un-parented from the larger cube, the LineRenderer behaves like I want it to: the hit data informs me it is being hit by the Raycast, but this does not hold true if the smaller object is a child of the cube.

Is there a way of having this behaviour without having to un-parent the smaller object? It's like the smaller object is inheriting the parent's Layer, despite being on it's own Layer - does this sound like what is happening?

  • I have a LineRenderer that ignores certain Layers based on a Raycast using LayerMask.

  • I have a cube with a collider on a Layer which is ignored because of the LayerMask.

  • I have a smaller object inside the cube that is a child object of the cube and is on a layer that is not set to be ignored.

When this smaller object is un-parented from the larger cube, the LineRenderer behaves like I want it to: the hit data informs me it is being hit by the Raycast, but this does not hold true if the smaller object is a child of the cube.

Is there a way of having this behaviour without having to un-parent the smaller object? It's like the smaller object is inheriting the parent's Layer, despite being on it's own Layer - does this sound like what is happening?

  • I have a LineRenderer that ignores certain Layers based on a Raycast using LayerMask.

  • I have a cube with a collider on a Layer which is ignored because of the LayerMask.

  • I have a smaller object inside the cube that is a child object of the cube and is on a layer that is not set to be ignored. I need the Raycast to hit the smaller object.

When this smaller object is un-parented from the larger cube, the LineRenderer behaves like I want it to: the hit data informs me it is being hit by the Raycast, but this does not hold true if the smaller object is a child of the cube.

Is there a way of having this behaviour without having to un-parent the smaller object? It's like the smaller object is inheriting the parent's Layer, despite being on it's own Layer - does this sound like what is happening?

edited tags
Source Link
  • I have a LineRenderer that ignores certain Layers based on a Raycast using LayerMask.

  • I have a cube with a collider on a Layer which is ignored because of the LayerMask.

  • I have a smaller object inside the cube that is a child object of the cube and is on a layer that is not set to be ignored.

When this smaller object is un-parented from the larger cube, the LineRenderer behaves like I want it to: the hit data informs me it is being hit by the Raycast, but this does not hold true if the smaller object is a child of the cubechild of the cube.

Is there a way of having this behaviour without having to un-parent the smaller object? It's like the smaller object is inheriting the parent's Layer, despite being on it's own Layer - does this sound like what is happening?

  • I have a LineRenderer that ignores certain Layers based on a Raycast using LayerMask.

  • I have a cube with a collider on a Layer which is ignored because of the LayerMask.

  • I have a smaller object inside the cube that is a child object of the cube and is on a layer that is not set to be ignored.

When this smaller object is un-parented from the larger cube, the LineRenderer behaves like I want it to: the hit data informs me it is being hit by the Raycast, but this does not hold true if the smaller object is a child of the cube.

Is there a way of having this behaviour without having to un-parent the smaller object? It's like the smaller object is inheriting the parent's Layer, despite being on it's own Layer - does this sound like what is happening?

  • I have a LineRenderer that ignores certain Layers based on a Raycast using LayerMask.

  • I have a cube with a collider on a Layer which is ignored because of the LayerMask.

  • I have a smaller object inside the cube that is a child object of the cube and is on a layer that is not set to be ignored.

When this smaller object is un-parented from the larger cube, the LineRenderer behaves like I want it to: the hit data informs me it is being hit by the Raycast, but this does not hold true if the smaller object is a child of the cube.

Is there a way of having this behaviour without having to un-parent the smaller object? It's like the smaller object is inheriting the parent's Layer, despite being on it's own Layer - does this sound like what is happening?

Source Link

Raycast does not detect child layer if parent layer is set to ignore

  • I have a LineRenderer that ignores certain Layers based on a Raycast using LayerMask.

  • I have a cube with a collider on a Layer which is ignored because of the LayerMask.

  • I have a smaller object inside the cube that is a child object of the cube and is on a layer that is not set to be ignored.

When this smaller object is un-parented from the larger cube, the LineRenderer behaves like I want it to: the hit data informs me it is being hit by the Raycast, but this does not hold true if the smaller object is a child of the cube.

Is there a way of having this behaviour without having to un-parent the smaller object? It's like the smaller object is inheriting the parent's Layer, despite being on it's own Layer - does this sound like what is happening?