Alexygen Posted June 23, 2020 Share Posted June 23, 2020 Hello. I find example How to make the ball flatten when it hits the wall? If I add code: .to( ball, { duration: 3, scaleY: 0.5, scaleX: 1.3, ease: "myBounce-squash", transformOrigin: "bottom", } ) and code import { CustomBounce } from "./plug/CustomBounce.js" import { CustomEase } from "./plug/CustomEase.js" gsap.registerPlugin(Draggable, InertiaPlugin, CustomBounce, CustomEase) CustomBounce.create("myBounce", { strength: 0.7, squash: 3 }) this not work See the Pen 7c4eae8dd686a125d631da761b164f2d by osublake (@osublake) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted June 23, 2020 Share Posted June 23, 2020 Hey Alexygen. You'd need to modify the checkBounds function to fire a squash animation based on the wall that it's hitting. Using CustomBounce won't really help you here as the animation has to be more dynamic. Here's a really rough approximation that should be enough to get you started: See the Pen YzwVjbR by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
Alexygen Posted June 23, 2020 Author Share Posted June 23, 2020 Thank you!!!! 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