Jump to content
Search Community

Bounce ball off the edges of viewport constantly

xoxoxoxo test
Moderator Tag

Recommended Posts

I have a ball that bounces when it reaches the edges of viewport, I have this working with modifiers.

 

However, I'm trying to do this infinitely which I have tried by calling the tween function again but visually there's a slight pause when it restarts. How can I fix this?

An approach I thought of was to make my translate values longer and adjust duration but this wouldn't frequently touch the edge of the viewports.

See the Pen QWEKyMQ?editors=0010 by nullhoooook (@nullhoooook) on CodePen

Link to comment
Share on other sites

@ZachSaucier I have just discovered the InertiaPlugin and was wondering if i can pair it with what i'm trying to achieve in the demo?

Basically the ball constantly moves and when it hits the viewport walls it bounces off. The solution I have going, it sporadically restarts without hitting any edges.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...