Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity Noob needing help on a mini golf game

Discussion in 'Editor & General Support' started by jhouser, May 8, 2009.

  1. jhouser

    jhouser

    Joined:
    May 6, 2009
    Posts:
    9
    Aloha,

    I have created most of my assets through blender (very basic designs), imported them into Unity, and have begun to create the first hole.

    I have hit a wall on a couple issues that I can't seem work out myself.

    My first issue is that I have placed what I call platforms (4ft by 4ft objects) with a separate cup inside. The platform is the right color, however the cup which is supposed to be a bright white, is not even noticeable in unity. So I guess my first question is how can I make the cup really bright without lighting up the main platform?

    Onto my next issue. I have the ball created and I am able to move it through a scene with the mouse. However I want to be able to hit the ball with something and have a camera follow it. I can get a camera to follow the ball however it rotates like crazy around the balls axis.

    This is just a prototype for now, but after I can get it up and running I will be looking to put a small team together and actually create this mini golf game, based off of my golf company that I have in real life.

    Thanks again for looking through this and for any help you can provide.
     
  2. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    429
    Make an object follow the ball and use that as the focus point for the camera, that way you won't get the tumble dryer effect.
     
  3. jhouser

    jhouser

    Joined:
    May 6, 2009
    Posts:
    9
    Thanks I will try that today.
     
  4. jhouser

    jhouser

    Joined:
    May 6, 2009
    Posts:
    9
    I parented up an empty to my ball just bit behind the ball and then applied a smooth camera follow to the empty. That didn't work, am I missing something here?
     
  5. jhouser

    jhouser

    Joined:
    May 6, 2009
    Posts:
    9
    Any suggestions or places to look with regards to how I can set up a meter to hit my golf ball? I want to have the user hit a button and the longer they hold it down the more power it goes.

    I still can't figure out the camera from constantly rotating too.

    I love unity but I just can't seem to figure either of these issues out.

    Thanks in advance!!
     
  6. zeroZshadow

    zeroZshadow

    Joined:
    Feb 11, 2009
    Posts:
    30
    instead of linking the camera to the ball
    make a script that follow the camera (don't parent the cam to the ball !!!!)
     
  7. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
  8. jhouser

    jhouser

    Joined:
    May 6, 2009
    Posts:
    9
    Thanks guys, I appreciate it!!
     
  9. loidexe

    loidexe

    Joined:
    May 11, 2009
    Posts:
    10
    Im currently making a minigolf game myself.

    You must not parent the camera to the ball or else the camera will inherit the ball's entire transform (in this case, the ball's rotation). What you must do is make an empty game object and place it at the same position at the ball. Attach a script to that gameobject, telling it to copy the ball's position every update, like this:

    function Update() {
    gameobject.transform.position = ball.transform.position;
    }

    After you have done so, parent your camera to this empty game object so that the camera looks as if it is following the ball.
     
  10. loidexe

    loidexe

    Joined:
    May 11, 2009
    Posts:
    10
    Need help from physics experts.

    Im having problems with the way my ball behaves on non-flat surfaces with the way it rolls down under the influence of gravity. You see, after the ball loses its velocity and when it comes to rest in a non-flat surface, one should expect that the ball should roll down nicely until the ball is on a more flat surface.

    Yes, my rigidbody ball does that but the problem is it does so quite slowly as if its on a very sticky surface. It doesnt seem to be caused by friction, as I have turned values to zero with a combination of multiply but with no improvement.

    As I observe, this anomaly only happens when the ball is rolling downhill with most of its impact velocity used up. When the ball is rolling uphill (and of course, it can only do so with a fresh impact velocity) the surface doesnt seem to be sticky like that.

    [Update]
    More observations guys. When I tweak the fixed time step settings under time manager, I noticed some results. If I get it to a smaller value, say 0.001, the rolling looks stickier it even makes the ball halt to a full stop while on non-flat surfaces (when it should still roll down). But when I increase the timestep, say 0.1, it solves my problem, the ball rolls down smoothly as it should but it introduces a new problem. Since physics is computed less frequently, there could be times that the ball goes through solid objects as if there's no collision.

    Now everything seems more complicated... BTW, my default timestep is at 0.01
     
  11. TBoxman

    TBoxman

    Joined:
    Aug 2, 2008
    Posts:
    29
    No more replies on this thread in the past year?

    I wonder if you guys got these two items working.

    I've just started a mini-golf game myself. I figured it would be a good first game to try and accomplish myself. I've only built the first hole as the modeling and texturing are not a problem. I'm using this first hole to test physics, and other necessities.

    I have the ball bouncing on the green. It looks okay, but stops abruptly.

    Now i need to find a way to emulate a club hitting the ball.

    This will be fun to figure out.

    Four!
    Terry
     
  12. maryjaimi

    maryjaimi

    Joined:
    Feb 27, 2015
    Posts:
    1
    HI,

    I am also working on setting up a golf game.

    Can you tell me how to add bunkers and cart paths on a golf course, where the ball recognizes these areas and bounce accordingly???

    Have no clue at all.....Please advise...
     
  13. WatTheDeuce

    WatTheDeuce

    Joined:
    Apr 17, 2015
    Posts:
    7
    The best way to achieve this would be to use seperate colliders for the different surfaces. You can then assign a different physics material to the seperate colliders which will allow you to adjust things like bounce and friction.

    Edit:Grammar