Learn
Motor Sınıfı
HapticService
Artık Kullanılmayan
Oluşturulamaz
Hizmet
Çoğaltılmamış

*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.


Özet
Yöntemler
SetMotor(inputType: Enum.UserInputType,vibrationMotor: Enum.VibrationMotor,vibrationValues: Tuple):()
Devralınan Üyeler

API Referansı
Yöntemler
GetMotor
Capabilities: Input
HapticService:GetMotor(
inputType:Enum.UserInputType, vibrationMotor:Enum.VibrationMotor
Parametreler
vibrationMotor:Enum.VibrationMotor
Dönüşler

IsMotorSupported
Capabilities: Input
HapticService:IsMotorSupported(
inputType:Enum.UserInputType, vibrationMotor:Enum.VibrationMotor
Parametreler
vibrationMotor:Enum.VibrationMotor
Dönüşler

IsVibrationSupported
Capabilities: Input
HapticService:IsVibrationSupported(inputType:Enum.UserInputType):boolean
Parametreler
Dönüşler

SetMotor
Capabilities: Input
HapticService:SetMotor(
inputType:Enum.UserInputType, vibrationMotor:Enum.VibrationMotor, vibrationValues:Tuple
):()
Parametreler
vibrationMotor:Enum.VibrationMotor
vibrationValues:Tuple
Dönüşler
()
Kod Örnekleri
HapticService:SetMotor()
local UserInputService = game:GetService("UserInputService")
local HapticService = game:GetService("HapticService")
local cachedInputs = {}
local keyToVibration = {
[Enum.KeyCode.ButtonL2] = Enum.VibrationMotor.Small,
[Enum.KeyCode.ButtonR2] = Enum.VibrationMotor.Large,
}
local function onInputChanged(property)
if property == "Position" then
HapticService:SetMotor(inputType, vibrationMotor, input.Position.Z)
end
end
local function onInputBegan(input)
if not cachedInputs[input] then
local inputType = input.UserInputType
if inputType.Name:find("Gamepad") then
local vibrationMotor = keyToVibration[input.KeyCode]
if vibrationMotor then
-- Bu girişi manuel olarak izleyerek titreşim motorunu doğru bir şekilde güncelleyin
cachedInputs[input] = input.Changed:Connect(onInputChanged)
end
end
end
end
UserInputService.InputBegan:Connect(onInputBegan)

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.