Pool Template. Cueball Does Not Move On Other Surfaces

Discussion in 'Buildbox 3.0' started by B.K., Sep 13, 2018.

  1. B.K.

    B.K. Boxer

    Joined:
    Sep 12, 2018
    Messages:
    4
    Likes Received:
    3
    Hi Guys,

    I wonder if anyone can assist me please?

    I'm a Buildbox newbie but I’ve been devouring all the tutorials etc for a couple of months now and am making steady progress. This is my second forum post, so please be gentle with me… ;-)

    I do have a lot of ideas for games and I'm working on one in particular where I need to use the cueball on different surfaces other than the Ground surface that comes standard with the Pool template. Or, if I MUST use a copy of the Ground surface, I need to raise it to a higher level than I am currently able to.

    I don't know if I'm missing something here. I can drop a cue ball onto the original pool table and everything works fine. However, I'm working on a game where I need to drop the cueball onto other surfaces at various levels. I've tried everything! I CAN drop the cueball onto surfaces other than the original ground surface in the Pool template, BUT it just sits there frozen. I’m unable to move it with the cue.

    Please see images below. I'm not sure how to upload/share bbdocs yet. ;-(

    In the image with 2 x pool tables side by side, the cueballs function perfectly on the left hand bottom table. They also function on the right hand table in this example, HOWEVER, I need to raise the right hand table up HIGHER. If you select everything on the right hand table and move it up the Y axis any higher than it currently is, the cueballs freeze so you can't move them as normal.

    I even set up a test (see pic) using different levels with various materials including an exact copy of the original ground level as well as dropping in a plane from the bb assets, but the balls just freeze on all surfaces other than the original table. They WILL slide very slowly down a ramp BUT you can’t aim or shoot using the cue as normal while they are on the ramp or any other surface.

    2xPool-tables-preview-web-800x462.jpg 2xPool-tables-web-800x583.jpg Pool-table-levels-web-800x391.jpg

    OK geniuses! What’s the solution??? ;-)
     
  2. DanFarfan

    DanFarfan Avid Boxer

    Joined:
    Sep 22, 2018
    Messages:
    101
    Likes Received:
    42
    Well, I don't have a definitive answer, but I do have great news and good news.
    The balls are not frozen. that's the great news (because you aren't dead).
    What's going on is you must click and drag away from the ball, not right on it. It's difficult to find the point to click.
    My suggestion is to start about 1 inch away and move a bit closer with each attempt.

    The good news is I think I found the place in the slingshot code you need to edit (at least 1 place, that is).
    In the TouchBegan() function, there is a line that hardcodes the y-coordinate to 0. pos.y = 0;
    TADA... that's only true for the "first" playing surface.
    Your second "ground" is higher and then much higher.
    Instead of pos.y = 0;
    try this...

    set pos.y = this.entity().component("Cue Ball").position().y;

    Unfortunately, that's a bit off. You need to subtract the radius of the Cue Ball, because the position of an object is the point dead center.
    That could be hardcoded if your cue balls don't change size.
    If they do, don't forget that 1/2 the distance of 2 spheres (the same size) touching is equal to the radius of the spheres..

    Good luck
    @DanFarfan
     
    B.K. likes this.
  3. B.K.

    B.K. Boxer

    Joined:
    Sep 12, 2018
    Messages:
    4
    Likes Received:
    3

    Thanks Dan.

    I really appreciate the time you took to investigate the issue and offer your solution. I'll give it a try.
    ;-)
    B.K.
     
  4. DanFarfan

    DanFarfan Avid Boxer

    Joined:
    Sep 22, 2018
    Messages:
    101
    Likes Received:
    42
    My pleasure. Let us know what you find.
     

Share This Page