preview
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
preview [2019/10/04 15:34] – [Generated Documentation] maxime | preview [2020/04/22 11:48] – vjraymon | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | Since 1.5, Foundation allows to mod Custom component and links it to a fbx (see Exemple02) | ||
- | :!: Please do not upload mods for Foundation | + | The following LUA code computes and returns the global Y elevation of water from a global position: |
+ | |||
+ | | ||
+ | local raycastResult = {} | ||
+ | |||
+ | -- Raycast from the _globalPosition + 1000 | ||
+ | -- to _globalPosition - 1000 | ||
+ | -- only on objects with a WATER flag | ||
+ | local FromPosition = { _globalPosition[1], _globalPosition[2]+1000, | ||
+ | local ToPosition = { _globalPosition[1], | ||
+ | if not self: | ||
+ | | ||
+ | | ||
+ | 2 ^ OBJECT_FLAG.WATER: | ||
+ | | ||
+ | | ||
+ | | ||
+ | else | ||
+ | | ||
+ | end | ||
+ | end | ||
+ | |||
+ | You can do the same with the ground by replacing OBJECT_FLAG.WATER by OBJECT_FLAG.GROUND | ||
+ | |||
+ | If the water (or the ground) is not found (for instance when the _globalPosition out of the map) then a warning is edited in the logs, and the code return the Y of the _globalPosition. | ||
- | ===== How to Access 1.4 Preview ? ===== | ||
- | Contact developer on our [[https:// | ||
- | ===== Generated Documentation ===== | ||
- | * [[preview: | ||
- | * [[preview: | ||
- | ===== New Features ===== | ||
- | * [[migration# | ||
- | * [[preview: | ||
- | * [[migration# | ||
- | * [[preview: | ||
- | * New [[preview: | ||
- | * | ||
- | * Map Modding will be there with the official update | ||
- | ===== Migration Notes ===== | ||
- | See in [[migration# |