Fusion icon indicating copy to clipboard operation
Fusion copied to clipboard

Spring setters don't work immediately after construction

Open dphfox opened this issue 1 year ago • 1 comments

:setPosition(), :setVelocity() and :addVelocity() are overwritten by the spring if called on the first frame of the spring's existence.

dphfox avatar Apr 15 '24 12:04 dphfox

Hello @dphfox, is setPosition() fixed yet?

local function createDamageHit(pos : Vector3, partOf : number?)
	if hitOnGoingAnim then
		task.cancel(hitOnGoingAnim)
		hitDamageRotAnim:set(0)
		hitDamageRotAnimSpr:setPosition(0)
		print("is it reset", Fusion.peek(hitDamageRotAnimSpr)) -- prints around 86-87
                -- hitDamageRotAnimSpr (spring) expected to reset at 0
	end

	hitDamagePos:set(pos)
	hitDamageTransparency:set(0)
	hitDamageRotAnim:set(90)
	hitOnGoingAnim = task.delay(1, function()
		hitDamageTransparency:set(1)
		hitDamageRotAnim:set(0)
	end)
end

Im using Fusion's version = {major = 0, minor = 3, isRelease = true} any workaround for this? sorry if this off topic.

Fastering18 avatar May 16 '25 09:05 Fastering18