setLinearVelocity.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. return {
  2. summary = 'Set the linear velocity of the Collider.',
  3. description = [[
  4. Sets the linear velocity of the Collider directly. Usually it's preferred to use
  5. `Collider:applyForce` to change velocity since instantaneous velocity changes can lead to weird
  6. glitches.
  7. ]],
  8. arguments = {
  9. vx = {
  10. type = 'number',
  11. description = 'The x velocity of the Collider, in meters per second.'
  12. },
  13. vy = {
  14. type = 'number',
  15. description = 'The y velocity of the Collider, in meters per second.'
  16. },
  17. vz = {
  18. type = 'number',
  19. description = 'The z velocity of the Collider, in meters per second.'
  20. },
  21. velocity = {
  22. type = 'Vec3',
  23. description = 'The velocity of the Collider, in meters per second.'
  24. }
  25. },
  26. returns = {},
  27. variants = {
  28. {
  29. description = 'Set the linear velocity of the collider using numbers.',
  30. arguments = { 'vx', 'vy', 'vz' },
  31. returns = {}
  32. },
  33. {
  34. description = 'Set the linear velocity of the collider using a vector.',
  35. arguments = { 'velocity' },
  36. returns = {}
  37. }
  38. },
  39. notes = 'If the Collider is asleep, calling this function will wake it up.',
  40. related = {
  41. 'Collider:getLinearVelocityFromLocalPoint',
  42. 'Collider:getLinearVelocityFromWorldPoint',
  43. 'Collider:getAngularVelocity',
  44. 'Collider:setAngularVelocity',
  45. 'Collider:applyForce',
  46. 'Collider:getPosition',
  47. 'Collider:setPosition'
  48. }
  49. }