Share Posted October 25, 2016 Hi all, Been working on an explosion component in React and ran across the See the Pen VjPaLO by jscottsmith (@jscottsmith) on CodePen on Codepen. Excellent GSAP work there. Then I forked that and tweaked it a bit to what I was aiming for in See the Pen PGPVJz by anthonygreco (@anthonygreco) on CodePen . So far, so good. Then I started integrating this with React and found that I had to do things a bit different due to the way React works. After a bit of mucking around I feel like I've got things at least set up right but I'm encountering a peculiar outcome I'm wondering if anyone could assist with. I'm not sure if my issue lies in React, GSAP, or possibly even the layout with CSS. Here's the See the Pen ALwYYN by anthonygreco (@anthonygreco) on CodePen pen I'm working on (the main Codepen URL on this post). It appears as if everything seems to be working aside from the Physics2DPlugin. Anyone have any thoughts? See the Pen ALwYYN by anthonygreco (@anthonygreco) on CodePen Link to comment Share on other sites More sharing options...
Share Posted October 25, 2016 Hi Anthony, nice demo. I know nothing of react but it appears your values may need to be altered. I hardcoded gravity and friction and it seems the physics stuff works: http://codepen.io/GreenSock/pen/jrJjGb?editors=0010 1 Link to comment Share on other sites More sharing options...
Author Share Posted October 26, 2016 My Hero. Turns out I simply wasn't passing the props from the Explosion component to the SpriteContainer component and then further down to the Sprite component. I updated the pen and all appears to be working as expected now. Thanks Carl! 1 Link to comment Share on other sites More sharing options...
Share Posted October 26, 2016 Glad I could help. Going into it I wasn't so sure 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now