AnimationClip.SetCurve(string relativePath, userdata type, string propertyName, AnimationCurve curve)
Assigns the curve to animate a specific property.
Parameters:
Name | Type | Description |
---|---|---|
relativePath | string | Path to the game object this curve applies to. The relativePath is formatted similar to a pathname, e.g. "root/spine/leftArm". If relativePath is empty it refers to the game object the animation clip is attached to. |
type | userdata | The class type of the component that is animated. |
propertyName | string | The name or path to the property being animated. |
curve | AnimationCurve | The animation curve. |
Usage
---@type AnimationClip
local animationclip;
---@type string
local relativePath;
---@type userdata
local type;
---@type string
local propertyName;
---@type AnimationCurve
local curve;
animationclip.SetCurve(relativePath, type, propertyName, curve)
Extra Detail
If curve is null the curve will be removed. If a curve already exists for that property, it will be replaced. Note: SetCurve will only work at runtime for legacy animation clips. For non-legacy AnimationClips it is an editor-only function.