How Can I Make A Ball Bounce Of The Edge Of The Screen

Discussion in 'How Can I...?' started by tekno_boy, Mar 29, 2020.

  1. tekno_boy

    tekno_boy Boxer

    Joined:
    Mar 28, 2020
    Messages:
    1
    Likes Received:
    0
    Hi.

    My son and I are new to Buildbox and we like it very much.

    We jumped in and watched tutorials and pretty quickly built something quite cool, until we hit a wall.

    We simply want to make a ball (in this case a circle in 2D) move forward at an angle and simply bounce off the edge of the screen and continue inside the viewable area until it hits the next edge and bounce again et infinitum.

    Think of a red circle moving on a 45 degree angle and when it hits the edge of the screen, "bounces" back inside as it would do normally at about a 90 degree angle from where it came.

    We spent four 8 hours collectively trying to figure out how to do it.

    We are open to any suggestions, ones where the movement is set and then the angle changes or where a collision with the edge of screen changes the movement type from positive x,y to negative xy etc My son even said we could spawn a different circle going the other was uising an if colido (I'm sure there must be a better way to do this).-

    Also, we would be happy for the circle to be a sphere in 3D and to use physics. Or not us physics, we don’t care.

    We simply want to make a “ball” bouncing around the screen and cannot figure one way to do it.

    One last thing, I say “edge of the screen” because ideally it would work on any screen size this way and I guess it must be possible (after all, there are ways to stick to the edge of the screen).

    We would appreciate any help. Sorry if we are being noobs, we did put considerable effort into understanding collisions, physics, advanced moves etc and after two of us working independently to figure it for 4 hours I am asking here.
     
  2. Peter Hamiltom

    Peter Hamiltom Boxer

    Joined:
    Aug 15, 2020
    Messages:
    1
    Likes Received:
    0
    You could use one of the pre-made templates in the main Buildbox menu to see how the ball physics and nodes work, for example you could look at the ball flipper template.
     

Share This Page