How To Make A Unity Mini Golf Game (part 1)

Поделиться
HTML-код
  • Опубликовано: 1 дек 2024

Комментарии • 47

  • @sourlesscream1272
    @sourlesscream1272 6 месяцев назад +2

    for a simple fix, easier for my brain to process as its what i am used to for games i have played in the past
    instead of this
    rb.AddForce(direction * strength * shotPower);
    i did this
    rb.AddForce(-direction * strength * shotPower);
    just so you pull back on the mouse to increase power. ofc it is all preference, but this is what I prefer

  • @thefallenlime
    @thefallenlime Год назад +3

    Was considering making a mini golf game over the summer and this is the perfect start.

  • @markstar6899
    @markstar6899 3 года назад +4

    Nice video,really curious to know how you're gonna limit the player drag distance.

    • @AIAdev
      @AIAdev  3 года назад

      This could be done by splitting the worldPoint into a normalized vector3 and it's strength (vector3.magnitude). Then clamping the strength between 0 and some max value. Then we could reconstruct the vector3 based on that.

    • @GreekGamerJim
      @GreekGamerJim Год назад

      @@AIAdev I know this is an old video but could you provide an example of this? I've been trying to figure it out for hours now.

    • @rc0d3
      @rc0d3 Год назад +1

      @@GreekGamerJim I didn't see the video but the logis is that the vector3.normalized is the vector with the minimium to get the direction, and the vector3.magnitude is how many minimiun (nomalized) fits in.
      then you limiting the magnitude of vector (ex if the magnitude is 10, and you want the max to 5, you createnew verctor with minimium times 5, (normalized times 5 in this case)).
      now you clamp the values based on that (limit these values between 2 numbers), starting from 0 to max value (max force applied to ball)
      you can use chatgpt to help you on that...

  • @kelpez
    @kelpez 3 года назад +1

    Please make more parts to this

    • @AIAdev
      @AIAdev  3 года назад

      I’m currently working on a next part :)

  • @YoyoIsMeXD
    @YoyoIsMeXD Год назад +1

    Can anyone tell me the physics materials values i should attached to my ground and ball cuz my ball bounces and then goes in a straight line.... Plz help

  • @muhammadabubakar6149
    @muhammadabubakar6149 Год назад

    my linerenderer in not displaying correctly like instead it displaying from the centre of the ball it appears on a random part of my screen, How do I fix this?

    • @GhazyAzhar
      @GhazyAzhar 10 месяцев назад

      do you have any solution?

    • @SerinitySW
      @SerinitySW 7 месяцев назад +2

      @@GhazyAzhar I set the line renderer to "Use World Space" and it fixed this issue for me.

    • @sourlesscream1272
      @sourlesscream1272 6 месяцев назад

      @@SerinitySW thank you

  • @kioka2
    @kioka2 3 года назад +1

    Thank you very much for the content! A question, I would like to change the direction that drags the mouse, instead of dragging forward, dragging backward, do you have any idea how to solve it?

    • @AIAdev
      @AIAdev  3 года назад +2

      Around 10:15 I add a ShotPower variable to the script. If you assign a negative value to that variable in the inspector the force that gets applied to the ball will be in the opposite direction of the dragged force.

    • @kioka2
      @kioka2 3 года назад

      ​@@AIAdev Thanks for the reply man! I actually meant it like this:
      Currently in the script the player needs to drag the mouse forward and the line renderer will go in the same direction as the mouse, but how do I drag the mouse backward and keep making the line renderer show the same forward direction in the video, so the line renderer will go in the opposite direction of the mouse and the object will be thrown in the direction of the line renderer. Sorry for my English

    • @AIAdev
      @AIAdev  3 года назад +1

      @@kioka2 You could try doing some vector math to rotate the 2nd point drawn by the renderer by 180°. This seems like a case where Dot.Product would also work but I admittedly don't fully understand how to use that to be able to help.

    • @kioka2
      @kioka2 3 года назад

      @@AIAdev Thank you man!

    • @ProdbyHuskije
      @ProdbyHuskije 3 года назад +1

      haha was about to ask the same question

  • @yarilcaos
    @yarilcaos 3 года назад

    This its greath, thanks man!

    • @AIAdev
      @AIAdev  3 года назад

      You're welcome! Thanks for leaving a comment :)

  • @irrelevantengine7488
    @irrelevantengine7488 2 года назад

    For some reason it is random when i shoot the ball. Like the ball decides when it wants to shoot and when it doesn't. Do you know why this happens?

    • @AIAdev
      @AIAdev  2 года назад

      Without seeing your code and how your scene is set up, it’s hard to say. Feel free to join the discord in the description and I can help you out there

    • @GreekGamerJim
      @GreekGamerJim Год назад +3

      You are checking for inputs in the FixedUpdate function. FixedUpdate, instead of running once every frame, only runs once every physics tick, depending on the physics in your scene there may be more than one tick per frame or one tick every 10 frames.

    • @muhammadabubakar6149
      @muhammadabubakar6149 Год назад

      thanks man helped me alot also my linerenderer in not displaying correctly like instead it displaying from the centre of the ball it appears on a random part of my screen, How do I fix this?@@GreekGamerJim

  • @kadensim4000
    @kadensim4000 2 года назад

    where did u get the box part and that from the start

    • @AIAdev
      @AIAdev  2 года назад

      I constructed it using Probuilder in Unity

  • @physicstech8057
    @physicstech8057 2 года назад

    Very good video. How to make this works in android phone by the touch of the user?

    • @YoyoIsMeXD
      @YoyoIsMeXD Год назад

      Its a bit late but the mouse input already works with touch ive tried it

  • @bestshorts4279
    @bestshorts4279 2 года назад

    Awesome

  • @Desvelar
    @Desvelar 3 года назад

    When are we getting part two? I am excited!

    • @AIAdev
      @AIAdev  3 года назад

      I'm glad to hear it! I'll put something together soon

    • @AIAdev
      @AIAdev  3 года назад

      I don't know if you've seen part 2 yet but it went live last week! ruclips.net/video/nPYoQ09q-xw/видео.html

  • @danegamedev
    @danegamedev 3 года назад +1

    Simple and explained well

    • @AIAdev
      @AIAdev  3 года назад +1

      Thank you!

  • @Bloopblop1
    @Bloopblop1 3 года назад

    Amazing video keep going :)

    • @AIAdev
      @AIAdev  3 года назад

      thanks :)

  • @kelpez
    @kelpez 3 года назад

    When's the next part?

    • @AIAdev
      @AIAdev  3 года назад +1

      Next week :)

    • @kelpez
      @kelpez 3 года назад

      @@AIAdev ok thanks