Help Me!

Hello everyone and thanks if you guys reply! I have two buttons that make a square rotate. But i want balls to bounce off of the square. If i have my square on movable, the ball will push the square right off my screen out of its position. If i leave it on non movable i can't rotate the square. Can someone fix this problem?

Comments

  • ArmellineArmelline Member, PRO Posts: 5,421

    Rotate the square using interpolate is one option.

    Another is to constrain the x and y position of the square. This isn't always entirely reliable, though.

    Alternatively, don't use the collide behaviour to bounce the balls off it, instead looks at the x and y velocity and angle of movement of the ball and when it overlaps with the square, calculate the direction it should move.

    Interpolating the rotation is probably the best option, though.

  • kylemik23kylemik23 Member Posts: 7

    Thanks but how do you use interpolate? @Armelline

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @kylemik23 said:
    Thanks but how do you use interpolate? Armelline

    :s

  • ookami007ookami007 Member Posts: 581

    Another idea is to give the balls a density of like 1 and give the square a density of 999,999... the balls shouldn't be able to move the square at all at that point.

Sign In or Register to comment.