Sets animation playback time and animation index (manual time control, seeks to specific position).
Takes entity (animated mesh entity handle), time (playback position in seconds, can be any value within animation duration), animIndex (animation index 0-based, selects which animation to use from GLB file).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityInt
timeDouble
animIndexInt
Returns
Void
Quick Summary
Sets animation playback time and animation index (manual time control, seeks to specific position).
Takes entity (animated mesh entity handle), time (playback position in seconds, can be any value within animation duration), animIndex (animation index 0-based, selects which animation to use from GLB file).
Returns nothing.
Technical Exegesis...
Sets animation playback time and animation index (manual time control, seeks to specific position). Takes entity (animated mesh entity handle), time (playback position in seconds, can be any value within animation duration), animIndex (animation index 0-based, selects which animation to use from GLB file). Returns nothing. Sets entity.animatedMesh.currentTime = time and entity.animatedMesh.currentAnimationIndex = animIndex (directly modifies playback state).
Sets animation playback time and animation index (manual time control, seeks to specific position). Takes entity (animated mesh entity handle), time (playback position in seconds, can be any value within animation duration), animIndex (animation index 0-based, selects which animation to use from GLB file). Returns nothing. Sets entity.animatedMesh.currentTime = time and entity.animatedMesh.currentAnimationIndex = animIndex (directly modifies playback state). Use for manual animation control (scrubbing timeline, precise positioning), synchronized animations (align multiple characters to same time), or debugging (jump to specific frame to test pose). Manual time control: sets currentTime directly (bypasses normal playback advancement, immediate seek), can set to any value (0.0 to animation duration, or beyond for wrapping), doesn't affect playing state (animation continues playing if was playing, paused if was paused), next UpdateAnimations uses this time (skeleton pose updated to match time position). Animation index: selects which animation from GLB file (GLB can contain multiple animations, index 0 = first, 1 = second, etc.), currentAnimationIndex used for playback (determines which keyframes to sample, independent of sequences), typically 0 for single-animation files (most GLBs have one animation, index 0). Use cases: (1) Frame scrubbing (scrubber = 0.5, b3dSetAnimTime(player, scrubber, 0) for timeline editor), (2) Synchronized animation (b3dSetAnimTime(npc1, leaderTime, 0) sync NPCs to leader's time), (3) Animation testing (b3dSetAnimTime(character, 1.5, 0) jump to 1.5s to test specific pose), (4) Cutscene control (set exact time for cutscene frames, manual playback control). Common patterns: scrub = b3dSetAnimTime(entity, slider_value, 0) timeline scrubbing; sync = For Each npc: b3dSetAnimTime(npc, masterTime, 0) synchronize group; reset = b3dSetAnimTime(entity, 0.0, 0) reset to start. Typical usage: pause animation (b3dPauseAnimSeq stops automatic advancement), set time manually (this function seeks to position), resume if needed (b3dResumeAnimSeq continues from new position), useful for frame-by-frame control (pause, adjust time, pause again). Time wrapping: if time > animation duration behavior depends on mode (loop wraps around, once stops at end, pingpong reverses), engine handles wrapping automatically (no need to clamp manually), negative time handled (wraps to end in loop mode). Animation index validation: no bounds checking (out-of-range index may crash or display nothing, user must ensure valid), typically use 0 (single animation files have one animation at index 0), multi-animation files (use b3dAnimLength or check GLB metadata for animation count). Doesn't affect speed or mode: speed/looping/pingPong unchanged (only currentTime and animIndex modified), playback continues with existing settings (if playing before SetAnimTime, continues playing after), mode 0 stop still stops (setting time on stopped animation doesn't start playback). Difference from b3dAnimate: b3dAnimate starts playback (sets mode, speed, frame range, begins playing), b3dSetAnimTime seeks within playback (moves playback head, doesn't change mode/speed), b3dAnimate for playback control (start/stop/loop), b3dSetAnimTime for timeline control (seek/scrub). Validation: only affects ENTITY_ANIMATED_MESH (non-animated entities ignored), silent if entity not found (invalid handle or wrong type, no error), accepts any time value (no clamping, wrapping handled by UpdateAnimations), accepts any animIndex (no validation, user responsibility). Related: b3dAnimTime queries current time (reads currentTime set by this function), b3dAnimate starts playback (sets time to start of range, this function seeks after start), b3dAnimateSeq alternative playback (also uses currentTime internally, can seek with this function), b3dPauseAnimSeq pauses playback (useful before manual time control), b3dResumeAnimSeq resumes playback (continues from manually-set time), b3dAnimLength queries duration (useful to clamp time 0 to duration).