Previous: , Up: Interaction   [Contents][Index]


9.13 Wall Section

Component: WallSection

This component swaps out a prefab based on neighboring rules. It also rotates the object so you don’t need a prefab for each direction. Great for dungeon crawlers, or user-created walls. It assumes it’s instantiated in the correct position for the prefab edges to line up correctly.

Field of WallSection: GameObject inlineConnection

Straight line wall, across the X axis

Field of WallSection: GameObject tIntersection

The bottom of the T should face down the -z

Field of WallSection: GameObject intersection

4-way cross section

Field of WallSection: GameObject dogLeg

Should go down the -Z and +X axes

Field of WallSection: Vector3 raycastOffset

Where to offset the raycast from origin to check for neighbors

Default value: Vector3.up

Field of WallSection: float rayLength

Distance from origin+offset to raycast out for neighbors, goes in cardinal directions

Default value: 2.0f

Field of WallSection: LayerMask rayMask

Collision mask for objects that count as walls

Field of WallSection: GameObject inlineConnection

Straight line wall, across the X axis

Field of WallSection: GameObject tIntersection

The bottom of the T should face down the -z

Field of WallSection: GameObject intersection

4-way cross section

Field of WallSection: GameObject dogLeg

Should go down the -Z and +X axes

Field of WallSection: Vector3 raycastOffset

Where to offset the raycast from origin to check for neighbors

Default value: Vector3.up

Field of WallSection: float rayLength

Distance from origin+offset to raycast out for neighbors, goes in cardinal directions

Default value: 2.0f

Field of WallSection: LayerMask rayMask

Collision mask for objects that count as walls


Previous: , Up: Interaction   [Contents][Index]