Jump to content
Search Community

CryOfGaming

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by CryOfGaming

  1. I just made a quick function which allows me to update variables and pass a boolean to either run the “slow” easing-adjusting code or the faster code. Yea, I just changed top/left values in the CodePen for visualization. I mainly work with HTML5 canvases and need to change lots of object positions with GSAP. About the DynamicPropsPlugin, It's not really required right now. Might be a QoL thing, especially if it would have very good performance. But if its not available, that's perfectly fine and not a big deal. Thank you so much again for your help!
  2. Yes the restart fixed the problem. THAnk YOu I need to have all performance possible, what do you suggest to use for the best performance? Should i use the method you provided (which also works awesome) or the fixed answer with "tween.restart()"? If we already talk here, does the "DynamicProps" Plugin exist for 3.x? If yes, where can i get it? And also, is the plugin performant? Everything needs to run as performant as possible, even just a millsec. Slower can be a big problem
  3. Thank you for your help! Unfortunatly it seems to not be the solution. This is how it looks in 2.x with "updateTo" which is exactly what i want: https://codepen.io/cryofgaming/pen/PoBrabR A nice, smooth update. And as you exactly said, it speeds up to reach the targetposition because it has less and less time available. And this is the solution, you provided. It's not smooth and jumps around. https://codepen.io/cryofgaming/pen/MWBMXeM I hope it's understandable what i try to achieve.
  4. Hello, i wanted to upgrade from the old 2.x to the latest 3.x GSAP. Mostly everything is working, except the code below. I need to update variables during the animation without changing or resetting the duration—it should just continue to the new path like nothing happened. In 2.x it was working perfectly, now im messing around with "quickTo()", "invalidate()", trying to get the old "duration()" and inserting it in the updated tween, but nothing works like in 2.x. Could someone suggest me how to achieve the same 2.x updateTo() effect without resetting the duration? It's also important to be as efficient as possible. Lots of objects get created, each having this update function which get called many times per second in each individual object. Thank you! this.Tween.updateTo({ x: newPositionX, y: newPositionY }, false); //false = Dont reset duration!
  5. Hello, i have a project running in html5 canvas. Since i cannot tell anything about the project itself, i try to make it easy to understand with other stuff. Lets call the first object A and the second object B Object A gets moved by the users mouse (i handled that without TweenLite) and object B should stay to the same relative position as object A. Object A can rotate, when it rotates object B rotates around object A to get the same relative position. This all works perfectly. This code gets called around 150 times a second to try bring object B to the target position at A. TweenLite.to(this, 0.5, {x: this.targetX, y: this.targetY, }) (decreasing duration in this code will look bad, so when i make it on 0.1 its lags not a lot behind but it looks bad) Now the problem i have is that object B lags behind as long object A is moving. When object A stops, object B has no problem to reach the target position but since object A is constantly moving, object B wont reach object A. I tried to make some picutres to make it understand it better: Here you see object not moving - everything is good. Object B is in correct position Now object A rotatet a bit around, object B followed. Also looks good ( think it also lags a bit behind, but since the rotation is not fast, its not noticable) But now object A starts speeding up to a higher constant speed - object B trys to follow with the code that gets called 150 times per second, but it looks like that: I hope i somehow made it understandable ? So basically everything is working, rotation is looking good (nvm that small lag cause of the low rotation speed) but as soon it speeds up, object B got a distance which wont go any closer. Thank you for any help!
  6. https://codepen.io/cryofgaming/pen/QWvGMMK here u go. Hope you can figure out whats broken
  7. I opened both and both are 3.7.0 (i checked, the old one also send that warning. Did just not saw it cause my console got spammed)
  8. Thanks for the quick response. I used your gsap.min.js which you used in codepen now and it shows me: But wihtout "-short" it works perfectly fine and loggst the position.
  9. Hello, anyone any idea why this code wont print the current rotation in the console? gsap.to(this, { duration: 2, rotation: "-170_short", modifiers: { rotation: function(x) { console.log(x); }, }, ease: "none" }) When i remove the "_short" it works perfectly fine. Thank you!
×
×
  • Create New...