User Tools

Site Tools


guides:compute-water-elevation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
guides:compute-water-elevation [2020/04/23 18:39]
vjraymon
guides:compute-water-elevation [2021/02/23 11:52] (current)
minotorious wording edit
Line 1: Line 1:
-====== Custom ​componenthow to compute ground ​or water elevation ​====== +====== Custom ​ComponentComputing Ground ​or Water Elevation ​======
- +
- +
-Since 1.5, Foundation allows to mod Custom component and links it to a fbx (see Exemple02)+
  
 The following LUA code computes and returns the global Y elevation of water from a global position: The following LUA code computes and returns the global Y elevation of water from a global position:
Line 31: Line 28:
 You can do the same with the ground by replacing OBJECT_FLAG.WATER by OBJECT_FLAG.GROUND 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 returns the Y of the ''​_globalPosition''​.+If water (or ground) is not found (for instance when the ''​_globalPosition'' ​is outside ​the map) then a warning is entered ​in the logs, and the code returns the Y of the ''​_globalPosition''​
 + 
 +This can be used, for instance, when moving an object on the ground or water whatever the slope.
  
-This can be used, for instance, when moving an object on the ground or water whatever the slope (the water HAVEN'the same elevation ​anywhere ​on a vanilla map !).+Note: Water doesn't have the same elevation ​at all points ​on a vanilla map!
  
guides/compute-water-elevation.txt · Last modified: 2021/02/23 11:52 by minotorious