Skip to main content

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 originates
  • startWidth: float - The initial width of the shockwave
  • endWidth: float - The final width of the shockwave
  • startHeight: float - The initial height of the shockwave
  • endHeight: float - The final height of the shockwave
  • duration: float - The duration of the shockwave effect in seconds
  • intensity: float - The intensity of the shockwave
  • falloff: 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)