현대 컨트롤러와 장치에는 촉각 피드백을 제공하기 위해 모터가 내장되어 있습니다.진동과 소음을 추가하면 시각적 또는 오디오전달하기 어려운 미묘한 피드백을 제공할 수 있습니다.
Roblox는 다음 장치에 대해 햅틱을 지원합니다:
- 대부분의 iPhone, Pixel 및 Samsung Galaxy 장치를 포함하는 하aptics를 지원하는 Android 및 iOS 전화
- 플레이스테이션 게임패드
- Xbox 게임패드
- 퀘스트 터치 컨트롤러
요약
속성
촉각 효과 루프가 연속으로 실행되는지 여부.
Radius 와 함께, 입력 장치에 대한 영향 위치와 효과적으로 근처 모터의 영향 범위를 지정합니다.
함께 Position , 입력 장치와 관련된 영향 반경과 효과적으로 근처 모터의 영향 범위를 지정합니다.
Enum.HapticEffectType 입력 유형을 설명하는 것.
메서드
촉각 효과를 재생합니다.
사용자 지정 웨이브포밼을 테이블로 정의하고 해피티크에 적용하는 데 사용되는 메서드.
촉각 효과를 중지합니다.
속성
Looped
촉각 효과 루프가 연속으로 실행되는지 여부.
local Workspace = game:GetService("Workspace")local effect = Instance.new("HapticEffect")effect.Type = Enum.HapticEffectType.GameplayExplosioneffect.Looped = trueeffect.Parent = Workspace-- Start the haptic effecteffect:Play()-- After two seconds, stop the effecttask.wait(2)effect:Stop()
Position
Radius 와 함께, 입력 장치에 대한 영향 위치와 효과적으로 근처 모터의 영향 범위를 지정합니다.일부 게임패드에는 "작은"과 "큰" 모터가 모두 없고 "게임패드 대형 왼쪽/오른쪽"이 PC에서 지원되지 않는다는 점에 유의하십시오.

local Workspace = game:GetService("Workspace")local effect = Instance.new("HapticEffect")-- Set the position and radius of impacteffect.Position = Vector3.new(0.5, 0.5, 0)effect.Radius = 1effect.Parent = Workspaceeffect:Play()
Radius
함께 Position , 입력 장치와 관련된 영향 반경과 효과적으로 근처 모터의 영향 범위를 지정합니다.일부 게임패드에는 "작은"과 "큰" 모터가 모두 없고 "게임패드 대형 왼쪽/오른쪽"이 PC에서 지원되지 않는다는 점에 유의하십시오.

local Workspace = game:GetService("Workspace")local effect = Instance.new("HapticEffect")-- Set the position and radius of impacteffect.Position = Vector3.new(0.5, 0.5, 0)effect.Radius = 1effect.Parent = Workspace-- Play the haptic effecteffect:Play()
큰 즉각적인 충격이 빠르게 사멸하는 경우와 같이 햅틱 유형, Enum.HapticEffectType.GameplayCollision 큰 즉각적인 충격이 빠르게 사멸하는 경우와 같이 햅틱 유형,Enum.HapticEffectType.Custom은 사용자 정의 웨이브폼 키를 통해 정의된 하aptic을 지정할 수 있게 해줍니다 SetWaveformKeys()를 통해 정의된 하aptic을 지정할 수 있게 해줍니다
Waveform
메서드
Play
촉각 효과를 재생합니다.
local Workspace = game:GetService("Workspace")local effect = Instance.new("HapticEffect")effect.Type = Enum.HapticEffectType.GameplayExplosioneffect.Parent = Workspace-- Play the haptic effecteffect:Play()
반환
SetWaveformKeys
이 메서드를 사용하면 테이블로 사용자 지정 웨이브포밍을 정의하고 해피티크에 적용할 수 있습니다.
local Workspace = game:GetService("Workspace")local effect = Instance.new("HapticEffect")-- Set effect type to custom in order to define a waveformeffect.Type = Enum.HapticEffectType.Customeffect.Parent = Workspace-- Define the custom waveform curve through a tablelocal rampUpWaveform = {FloatCurveKey.new(0, 0.3),FloatCurveKey.new(100, 0.4),FloatCurveKey.new(300, 0.8),FloatCurveKey.new(400, 1.0)}-- Set waveform through the effect's methodeffect:SetWaveformKeys(rampUpWaveform)
매개 변수
반환
Stop
촉각 효과를 중지합니다.
local Workspace = game:GetService("Workspace")local effect = Instance.new("HapticEffect")effect.Type = Enum.HapticEffectType.GameplayExplosioneffect.Looped = trueeffect.Parent = Workspace-- Start the haptic effecteffect:Play()-- After two seconds, stop the effecttask.wait(2)effect:Stop()