Jump to content


Draggable hit wall

Moderator Tag

Recommended Posts

Hi everyone, I'm newbie. Just want to know. how to restrict the direction of draggable while hit an another object. 
in the codepen example, I have a Green box is draggable. when we hit the Black box. i needs to act like wall.



See the Pen oNaaowL?editors=0010 by demo-ppad (@demo-ppad) on CodePen

Link to comment
Share on other sites

You're looking for collision detection. There are several threads about the topic around the forum. Here are a few to get you started.


  • Like 5
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.