setLinearDamping.lua 979 B

123456789101112131415161718192021222324252627282930313233343536
  1. return {
  2. summary = 'Set the linear damping of the Collider.',
  3. description = [[
  4. Sets the Collider's linear damping parameter. Linear damping is similar to drag or air
  5. resistance, slowing the Collider down over time. Damping is only applied when linear
  6. velocity is over the threshold value.
  7. ]],
  8. arguments = {
  9. damping = {
  10. type = 'number',
  11. description = 'The linear damping.'
  12. },
  13. threshold = {
  14. type = 'number',
  15. default = '0',
  16. description = 'Velocity limit below which the damping is not applied.'
  17. }
  18. },
  19. returns = {},
  20. variants = {
  21. {
  22. arguments = { 'damping', 'threshold' },
  23. returns = {}
  24. }
  25. },
  26. notes = [[
  27. When the Collider is created, it will use the world's linear damping value, which is set using
  28. `World:setLinearDamping`.
  29. A linear damping of 0 means the Collider won't slow down over time.
  30. ]],
  31. related = {
  32. 'World:getLinearDamping',
  33. 'World:setLinearDamping'
  34. }
  35. }