Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

RaycastHit.lightmapCoord

var lightmapCoord: Vector2;

Description

The uv lightmap coordinate at the impact point.

This can be used for sampling the lightmap and setting the sampled color value as the material color of a moving object to make it roughly match the baked lighting. This is simply the textureCoord2 transformed by lightmapTilingOffset.