Skip to main content

playheadPosition

The current playhead position of the Motion timeline, in seconds.

Signature

playheadPosition: number | undefined [readonly]

Remarks

Returns undefined when there is no active Motion timeline in the editor UI.

const node = figma.currentPage.selection[0]
const playheadPosition = figma.motion.playheadPosition

if (node && playheadPosition !== undefined) {
node.applyManualKeyframeTrack(
{ type: 'PROPERTY', name: 'OPACITY' },
{
baseValue: { type: 'FLOAT', value: 1 },
keyframes: [
{
timelinePosition: playheadPosition,
value: { type: 'FLOAT', value: 0 },
},
],
},
)
}