Skip to content

.range() Playcanvas

Alex edited this page Aug 20, 2020 · 1 revision

Ballistics.range(speed, height, [gravity])

  • speed (number) projectile speed
  • hieght (number) the height above ground the projectile will start from
  • gravity (number, optional) the current world gravity, defaults to project global settings
  • Returns 1 if range is larger than 0, otherwise returns 0

Calculate a maximum range that a ballistic projectile can be fired to on a given speed and gravity.