User Tools

Site Tools


preview

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
preview [2020/04/22 11:47] – created vjraymonpreview [2020/04/22 11:49] vjraymon
Line 4: Line 4:
 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:
  
-function MY_CUSTOM_COMPONENT:computeWaterElevation(_globalPosition)+    function MY_CUSTOM_COMPONENT:computeWaterElevation(_globalPosition)
     local raycastResult = {}     local raycastResult = {}
            
Line 22: Line 22:
          return raycastResult["Position"][2]          return raycastResult["Position"][2]
     end     end
-end+ end
  
 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

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki