เรียนรู้
Engine Class
GamepadService
ไม่สามารถสร้าง
บริการ
ไม่ซ้ำ

*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่


สรุป
คุณสมบัติ
วิธีการ
สมาชิกที่ได้รับทอด

เอกสารอ้างอิงเกี่ยวกับ API
คุณสมบัติ
GamepadCursorEnabled
การรักษาความปลอดภัยของสคริปต์ Roblox
อ่านพร้อมๆ กัน
ความสามารถ: Input
GamepadService.GamepadCursorEnabled:boolean
ตัวอย่างโค้ด
GamepadService - คุณสมบัติการเปิดใช้งานเคอร์เซอร์เกมแพด
local gamepadService = game.GamepadService
gamepadService:GetPropertyChangedSignal("GamepadCursorEnabled"):Connect(function()
local enabled = gamepadService.GamepadCursorEnabled
if enabled then
-- โค้ดที่กำหนดเองเมื่อเคอร์เซอร์เสมือนเปิดใช้งาน
else
-- โค้ดที่กำหนดเองเมื่อเคอร์เซอร์เสมือนปิดใช้งาน
end
end)

วิธีการ
DisableGamepadCursor
ความสามารถ: Input
GamepadService:DisableGamepadCursor():()
ส่งค่ากลับ
()
ตัวอย่างโค้ด
GamepadService - ปิดการทำงานของตัวชี้เกมแพด
local gamepadService = game.GamepadService
local userInputService = game.UserInputService
userInputService.InputBegan:Connect(function(inputObject, gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.ButtonB then
gamepadService:DisableGamepadCursor()
end
end)

EnableGamepadCursor
ความสามารถ: Input
GamepadService:EnableGamepadCursor(guiObject:Instance):()
พารามิเตอร์
guiObject:Instance
ส่งค่ากลับ
()
ตัวอย่างโค้ด
GamepadService - เปิดใช้งานตัวชี้เกมแพด
local gamepadService = game.GamepadService
local userInputService = game.UserInputService
local startObject = script.Parent
userInputService.InputBegan:Connect(function(inputObject, gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.ButtonA then
gamepadService:EnableGamepadCursor(startObject)
end
end)

©2026 Roblox Corporation. Roblox, โลโก้ Roblox และ Powering Imagination เป็นส่วนหนึ่งของเครื่องหมายการค้าที่จดทะเบียน และไม่ได้จดทะเบียนของเราในสหรัฐฯ และประเทศอื่นๆ