Thank you for your advice!
I created it before the loop started and made it to play right after the object reaches a certain float point. However, it suddenly goes to the right without animation still.
Do you think that my approach was wrong?
// Project: tweentest
// Created: 2018-05-17
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "tweentest" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
SetCameraPosition(1, 0, 155, 0)
SetCameraRotation(1, 45, 0, 0)
CreateObjectBox(1, 25, 25, 25)
SetObjectPosition(1, 0, 0, 75)
CreateTweenObject(1, 9)
SetTweenObjectZ(1, 75, 155, 0)
PlayTweenObject(1, 1, 0.5)
CreateTweenObject(2, 0.5)
settweenobjectx(2, 0, 35, 0)
do
if getobjectz(1) >= 154
secondtween = 1
endif
if secondtween = 1
PlayTweenObject(2, 1, 0.5)
secondtween = 0
endif
print(GetTweenChainPlaying(1))
print(secondtween)
UpdateAllTweens(0.5)
Print( ScreenFPS() )
Sync()
loop
Thank you!
www.alexmatei.com