Hello there, i have a problem with tweenservice. I want to use two different tweenInfo’s - one to move image in X axis, second to move image in Y axis, could you help me?
local tweenX = ts:Create(coin, tweenInfoX, {Position.X = UDim.new(0,targetX)})
local tweenY = ts:Create(coin, tweenInfoY, {Position.Y = UDim.new(0,targetY)})
this code ^^^ doesn’t work, i can’t tween position.X/Y (syntax err)
local tweenX = ts:Create(coin, tweenInfoX, {Position = UDim2.new(0,targetX,0,0)})
local tweenY = ts:Create(coin, tweenInfoY, {Position = UDim2.new(0,0,0,targetY)})
this code doesn’t make any errors but second tween overwrite the first one and i don’t want it.
just do
local tween = ts:Create(coin, tweenInfoX, {Position = UDim2.new(0,targetX,0,targetY)})
As i said, i have two different TweenInfo’s, i can not connect this in one…
i dont think you can fix the tween overwrite
the other way to do this are using loop
do you know if i can do any loop or something that will move my image BUT it will just “fire” and even if i’ll put there wait(100) it will not stop lines of code under it? something like romoteevent but in one script. i want my code to just fire this function and other lines of code will just go along with it
you can do the loop in different thread (by using coroutine) and then you wait for the remoteevent fire in the main thread
1 Like
thanks, i used some maths to move my image and coroutine to don’t stop main thread and it worked!