Show raw api
{
"functions": [
{
"name": "ObserveInputEnded",
"desc": "Observes when the input is ended",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable"
}
],
"function_type": "method",
"source": {
"line": 88,
"path": "src/inputobjectutils/src/Client/InputObjectTracker.lua"
}
},
{
"name": "GetInitialPosition",
"desc": "Gets the initial position for the input object",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Vector2"
}
],
"function_type": "method",
"source": {
"line": 97,
"path": "src/inputobjectutils/src/Client/InputObjectTracker.lua"
}
},
{
"name": "GetPosition",
"desc": "Observes input object position",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Observable<Vector2>"
}
],
"function_type": "method",
"source": {
"line": 106,
"path": "src/inputobjectutils/src/Client/InputObjectTracker.lua"
}
},
{
"name": "GetRay",
"desc": "Observes the input object ray",
"params": [
{
"name": "distance",
"desc": "Optional number, defaults to 1000",
"lua_type": "number?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<Vector2>"
}
],
"function_type": "method",
"source": {
"line": 121,
"path": "src/inputobjectutils/src/Client/InputObjectTracker.lua"
}
},
{
"name": "SetCamera",
"desc": "Sets the camera for the input object tracker to retrieve rays from",
"params": [
{
"name": "camera",
"desc": "",
"lua_type": "Camera"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 136,
"path": "src/inputobjectutils/src/Client/InputObjectTracker.lua"
}
}
],
"properties": [],
"types": [],
"name": "InputObjectTracker",
"desc": "Tracks an input object, whether it's a mouse or a touch button for position\nor mouse down.\n\nWorks around a bug in the mouse object where the mouse input objects are new\nper a mouse event.\n\n```lua\nlocal maid = Maid.new()\nlocal tracker = maid:Add(InputObjectTracker.new(initialInputObject))\n\nmaid:GiveTask(RunService.RenderStepped:Connect(function()\n\tprint(\"Input down at\", tracker:GetPosition())\n\n\t-- Can also cast a ray\n\tprint(\"Cast ray at\", tracker:GetRay())\nend))\n\nmaid:GiveTask(tracker:ObserveInputEnded():Subscribe(function()\n\tmaid:DoCleaning()\nend))\n\nmaid:GiveTask(tracker.InputEnded:Connect(function()\n\nend))\n```",
"source": {
"line": 30,
"path": "src/inputobjectutils/src/Client/InputObjectTracker.lua"
}
}