draw_animation animation speed value change offset?
Posted: Sun May 23, 2021 11:30 am
I am tying to run this animation on entity death, I want it only to be played once and to be able to change the animation speed per entity.
The problem is that it is randomly shifts the offset when changing the animation speed, and sometimes it even does shifts the offset for the same values. Does anyone know what the problem might be?
The problem is that it is randomly shifts the offset when changing the animation speed, and sometimes it even does shifts the offset for the same values. Does anyone know what the problem might be?
Code: Select all
local variableAnimation = table.deepcopy(data.raw["explosion"]["nuke-explosion"].animations.hr_version)
variableAnimation.name = "variableExplosion"
variableAnimation.type = "animation"
variableAnimation.dice_y = 0
variableAnimation.priority = "extra-high"
variableAnimation.animation_speed = 1
variableAnimation.shift = {0,0}
data:extend{variableAnimation}
Code: Select all
local animationSpeed = 1
local animationLife = 100
local animationOffset = 0
rendering.draw_animation{animation="variableExplosion", animation_speed=animationSpeed, target=position, time_to_live=animationLife, animation_offset = animationOffset, surface="nauvis"}