Terrain
Terrain.GetInfo (position: vec3): table
Gets information about the terrain at a given position.
Args:
position(vec3) - The position to get the terrain information for.
Returns (in table):
hitPos(vec3) - The position of the hit.normal(vec3) - The normal of the terrain at the hit position.height(number) - The height of the terrain at the hit position.hasHit(boolean) - Whether terrain was hit at the given position.
Example of getting the terrain information at the player's aim position:
local info = Terrain.GetInfo(Players.LocalPlayer():GetAimPosition())
print(info.hasHit, info.hitPos.x, info.hitPos.y, info.hitPos.z, info.height, info.normal.x, info.normal.y, info.normal.z)
Terrain.SpawnVegetationShockwave(position: vec3, startWidth: float, endWidth: float, startHeight: float, endHeight: float, duration: float, intensity: float, falloff: float): void
Spawns a vegetation shockwave effect that pushes vegetation away from the specified position.
Parameters:
position: vec3- The position where the shockwave originatesstartWidth: float- The initial width of the shockwaveendWidth: float- The final width of the shockwavestartHeight: float- The initial height of the shockwaveendHeight: float- The final height of the shockwaveduration: float- The duration of the shockwave effect in secondsintensity: float- The intensity of the shockwavefalloff: float- The falloff rate of the shockwave
Example:
-- Spawn a vegetation shockwave at an explosion position
Terrain.SpawnVegetationShockwave(vec3(1000, 100, 2000), 5.0, 20.0, 2.0, 5.0, 3.0, 1.0, 0.5)