TWEENING driving me craaazy !!!!
im trying to start a tween and stop it
the problem that the stop condition never work
when the start condition activated its just wont be stop
i tried it with behavior script and the same issue
i tried to change to ( frame update / move end .. ) just not working
HELP PLEASE
// -----JS CODE-----
// @input Component.ScreenTransform screenTransform
// @input Component.ScreenTransform screenTransform2
// @input SceneObject objectWithTweens
var pointA = script.screenTransform.getTransform().getWorldPosition();
var pointB = script.screenTransform2.getTransform().getWorldPosition();
var distance = pointA.distance(pointB);
if(distance <= 40.055){
global.tweenManager.startTween( script.objectWithTweens, "a1" );
}else {
global.tweenManager.stopTween( script.objectWithTweens, "a1" );
}
Thank you
A few things I notice here, first you need some sort of check if the tween has already been called or you're gonna be constantly calling or stopping it which won't let it play right and possibly slow performance.
Second, a distance of 40 for screen transforms is pretty high...in testing I couldn't spread them out even close to that far. Maybe you're using them differently but I still updated the value in the example code to 4.0055 instead.
Here's an example script I made with these changes, this should run on initialized:
Hi, just me!
Can I wonder what kind of Tween are you using?
I would suggest that for the screen transforms you are using TweenScreenTransform script and anchor type of tween.
I added output for the distance to see if it reaches desired value and a flag to check if tween is playing or not, so tween is not trying to start every frame.
Here is my code: (set this script to LensTurnedOn or Initialized event)
And here is a tween i use
Lets me know if there any questions!
Best
Olha
Whoops! Looks like I posted an answer at the same time with Brandon
Sorry for the duplication!
Thank you Olha - Brandon / Apoc for the responding
as you see im trying to make a slider where user can move and chose 4 different choices
i did every thing but the problem the tween not working with the type ( position to ) but working with type ( Offset )
the offset type not giving me the right position every time changed
the second problem when i activated the second tween its just stucking not even in the position
this is a preview video for the slider
https://www.4shared.com/video/61iwne_9ea/slider_prev.html
and this is the project im working on
https://www.mediafire.com/file/mktdbap8fq3ro46/NEW2.rar/file
Thank you so much
Hi, just me!
https://support.lensstudio.snapchat.com/hc/en-us/community/posts/360050394251-Select-HELP-How-to-create-slider-with-options-?page=1#community_comment_360008654031 here is one of your posts which I answered some time ago. Could you please take a look?
Best
Olha