Skip to main content
Y2JayC
Participant
September 12, 2017
Question

I'm wanting to make an object bounce off an object yet it bounces in unwanted direction.

  • September 12, 2017
  • 1 reply
  • 254 views

I want to make the ball that I have named ball_mc bounce off the posts and bars. I want the ball_mc to bounce off the leftpost_mc in a left direction, the ball_mc bounce off rightpost_mc in a right direction, and the ball_mc bounce off the bar_mc in an upward direction. I can't seem to figure this out and the ball bounces in directions that don't make sense to me. Can someone troubleshoot this for me.

This is what I've got so far.

Is this completely wrong?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
September 12, 2017

yes.

it's not clear what xDirection is doing but it probably should be -1 if it hits the left post and +1 if it hits the right.