Humanoid 또는 AnimationController에서 애니메이션 재생을 제어한다. 이 객체는 만들 수 없으며 대신
Humanoid:LoadAnimation 메서드에 의해 반환된다.
Events
1. Stopped()
AnimationTrack 재생이 끝날 때 실행된다.
이 이벤트는 여러 용도로 사용된다. 계속하기 전에 AnimationTrack이 중지 될 때까지 기다리는 데 사용할 수 있습니다 (예 : 일련의 애니메이션을 서로 연결하여 재생하는 경우). 또한 애니메이션 재생 중에 생성 된 모든 인스턴스를 정리하는데도 사용할 수 있다.
해당 애니메이션이 끝날 때까지 스크립트가 정지해 있다.
local function yieldPlayAnimation(animationTrack, fadeTime, weight, speed)
animationTrack:Play(fadeTime, weight, speed)
animationTrack.Stopped:wait()
print("Animation has stopped")
end
Function
1. AdjustSpeed
이 함수는 애니메이션의 AnimationTrack.Speed를 변경한다. 속도가 양수이면 애니메이션이 앞으로 재생되고, 음수이면 뒤로 재생되며, 0이면 일시 중지된다.
2. GetMarkerReachedSignal
이 함수는 애니메이션에서 지정된 KeyframeMarker가 적중되었을 때 발생하는 이벤트를 반환한다.
3. Stop
AnimationTrack을 중지한다. AnimationTrack의 재생이 호출되면 선택적인 fadeTime 매개 변수에 의해 지정된 시간 동안 애니메이션의 가중치가 0쪽으로 이동한다.
Property
1. Length
AnimationTrack의 길이 (초)를 반환하는 읽기 전용 속성이다. 애니메이션이 완전히로드 될 때까지 0을 반환하므로 즉시 사용하지 못할 수도 있다.
Code Sample
이 샘플은 AnimationId를 사용하여 애니메이션을 만든다. 그런 다음 애니메이션을 재생하기 전에 캐릭터의 Humanoid에 로드하여 AnimationTrack을 만든다.
local Players = game:GetService("Players")
local player = Players:FindFirstChild("Builderman")
local character = player.Character
local humanoid = character:FindFirstChild("Humanoid")
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=507771019" -- Roblox dance emote
local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play()
참고 링크
developer.roblox.com/en-us/api-reference/class/AnimationTrack
AnimationTrack
This Platform uses cookies to offer you a better experience, to personalize content, to provide social media features and to analyse the traffic on our site. For further information, including information on how to prevent or manage the use of cookies on t
developer.roblox.com
추가 공부 사항
댓글