Skrollr restarts gsap timeline animation - timeline

Does anybody have any experience in working with skrollr and gsap's timeline?
I have a few animations, and after applying skrollr to the page, with each scroll, the first animation is activated and played from the start.
The script is set to play the animation when reached, and after that it checkes a variable playing so it doesn't start over and over again (I already checked this with console.log and the animation doesn't get restarted there).
The problem is more subtle I fear, so if anyone can shed some light on this matter it would be greatly appreciated.
Thanks

Related

animation of an object wont center

hi guys i recently start experimenting lots of thing using points to make a particle effect and one of it try to create is a space wrap animation, the animation is correctly display but the position of the effect it wont center, it always goes in right or left i try to change the camera type and the position of the canvas camera it seems it dosen't help at all i think am missing something. can anyone help me to figure this out.
here is my code thanks
https://codesandbox.io/s/spacewrap-l82e3s?file=/src/App.js:0-1784

Lottie animation not working correctly

I developed this one pager which has Lottie Animation SVG
using the BodyMovin JS Script
Here is a link
http://clients.tipoos.com/scopio
Notice when you get to to the middle part where the title is:
DIAGNOSTIC EXPERTISE IS GEOGRAPHICALLY LIMITED. LET’S SET IT FREE.
You have this animation:
https://prnt.sc/iqoig0
The screen get stucked and the scroll effect is bad in that section
I don't know why it happens
and I can't get any answer anywhere
can anyone assist?
Thanks
apparently some containers are not yet in the DOM when you're trying to load the animations. You should make sure the element exists before loading an animation.
For example the element 'coin-mobile' doesn't seem to be present when loading the animation.

GSAP SVG Animation - Firefox glitch

I am working on an animation using GSAP and it is working perfectly on both Chrome and IE, Firefox however has the following glitches:
When the cup fill color fills up the color disappears as opposed to staying there. What looks as if the animation reverts to its original state.
While the big gear rotates around its center the other two seem to rotate around 0,0.
The animation can be found at:
http://codepen.io/anon/pen/WxJQQr
<code>
Any help or leads would be greatly appreciated, thanks!

SKSceneScaleModeResizeFill on ios8 scales improperly

I have written a game in SpriteKit using objective C and it works perfectly on ios9 but it looks hideous on ios8. I would really like to know how to fix this problem, either by “correcting” my mistake, or if I have no mistake then by finding a workaround for the bug in ios8.
I think I have really done all I can to make the problem as clear as possible, including making loads of screenshots to illustrate the problem and also making a new Xcode project that is as simple as possible while still showing the problem.
If you want to try the Xcode project, here is a link for it….
xcode project
If you want to see the screenshots of the problem, then here is a link for the screenshots.
Screenshots
Now I will try to explain the code I wrote and the problem illustrated in the screenshots.
PLEASE REMEMBER: My code works perfectly on iOS9.3. So my code is obviously not complete gargage. But admittedly, I am not an expert on handling screen rotation, so probably my code could be better.
I should probably mention that both scenes have scale mode set to SKSceneScaleModeResizeFill. I chose this mode because I had tremendous difficulty doing proper layouts for all possible screen sizes (including iPhone) when working with SKSceneScaleModeAspectFill. I do I hope I can solve this problem while sticking with SKSceneScaleModeResizeFill.
Anyway, my app is a SpriteKit game with two scenes. The main scene is the GameScene, where you play the game. And this scene has a pointer to the SettingsScene, where you can change the settings of the scene. (e.g. change the level of difficulty).
Anytime the user rotates the screen, GameViewController detects this change in viewWillTransitionToSize and tells the GameScene object about the new screen width and screen height. Game Scene then adjusts the positions of its sprites in consideration of the new screen orientation and then tells its SettingsScene object about the new screen width and height to that the Settings scene is properly laid out as well.
Please note that with this design, all sprites on BOTH scenes get repositioned any time the user rotates the screen REGARDLESS of which scene is actually active at that time..
As I said before, all works as expected on ios9.3. But on ios8, the result is attrocious. The screenshots illustrate one example of typical experience on ios8. If the user rotates the screen while using the game and then goes to the settings screen, he will see something awful. And will often be trapped in this terrible experience because the button for going back to the main game might not even be fitting on the screen anymore.
At first, it might seem like I am failing to reposition sprites for landscape mode in the settings scene. But this explanation is wrong. The text on the screen shows that the last layout was performed with the landscape orientation in mind.
So what is going wrong here?
Any suggestions would be highly highly highly highly appreciated.
Thanks!
-j
p.s. In case you don't want to look directly at the linked project file, here are some details about the example code. GameViewController implements viewTransitionToSize to handle any screen rotation. It directly tells the new screen dimensions to GameScene, which then tells SettingsScene. Both scenes rearrange their sprites in consideration of the new screen dimensions. And all goes well on ios9. On ios8, however, the inactive scene ends up looking hideaous when it is presented even though it clearly did reposition its sprites according to the new dimensions.
the problem is easily resolved by these lines....
gameScene.size = newScreenSize;
settingsScene.size = newScreenSize;
anytime the orientation changes.
This code is not required for ios9. The scene knows what size the screen is without assistance. But for ios8, it seems to be needed to add this code.

Unity 2D Animator, confusion on parameters and transitions for platform 2d character

I am new to designing games and have been having trouble for the past couple of days with the animator. I have downloaded a free asset off the Unity store that included a free sprite character and also its animations for idle, walk, run, and jump. My issue is when I go to use this asset pack in my game, I can not for the life of me figure out how to transition between idle->walk, and any state->jump. I believe it has to do with no parameters being set up, as I want the walk animation to occur when my character is moving. The issue is that it seems to be stuck in idle mode. In the animator the transitions are set up, but I can not figure out how to let the animator know when I am moving, and when I am actually idle. How can I connect my characters movement scripts to be used in conjunction with the animation? Do I need to write a new script, that uses new parameters I make in the animator, or am I completely missing something? Again I am very new at this, so I apologize if this is a dumb question but I cannot figure it out. All the videos I have watched only show how to build the animations and put them into the animator, and nothing about the scripts or parameters in specific. Thank you!
Look at the animation transition requirements, then set the required values. For example:
Animator anim = obj.GetComponent<Animator>();
anim.SetTrigger("running");
or
anim.SetFloat("speed", 2);
or
anim.SetBool("running", true);
One small thing that could be going wrong: If you somehow have a reference to the prefab instead of the instantiated object in your scene, it will not work. And to be sure it's not working, play the game, find the object with the Animator in the Hierarchy, click it, and open the Animator window. You can see which state is active.
If this doesn't help, can you describe the transitions in more detail?

Resources