PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

GetSunDirection

Returns a DataType/Vector3 representing the direction of the sun from the position 0, 0, 0.

Note, when the sun has set and is no longer visible, the DataType/Vector3 returned by this function will continue to point towards the sun below the map.

Developers looking to change the positioning of the sun should use the Lighting/ClockTime or Lighting/GeographicLatitude properties.

A variant of this function exists for obtaining the direction of the moon, Lighting/GetMoonDirection.

Returns

Return Type Summary

DataType/Vector3 representing the direction of the sun from the position 0, 0, 0.


Code Samples


Lighting:GetSunDirection

This example shows how this function can be used:

game.Lighting.TimeOfDay = "14:00:00"
game.Lighting.GeographicLatitude = 41.73
print(game.Lighting:GetSunDirection())