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

Поделиться
HTML-код
  • Опубликовано: 2 июн 2024
  • In this first episode on making a unity mini golf game, we go over the fundamentals of creating a system that allows players to click on the ball and drag in a direction to add a force.
    ► Socials
    Twitter: / the_real_aia
    Discord: / discord
    My free web games: aiadev.fun/
    ► Part 2: • Making A Unity Mini Go...
    ► Get the script: unicornone.gumroad.com/l/mini...
    ► Details on the raycast function: • Unity Drag and Drop Sc...
    ► Download Unity 3D: on.unity.com/3cbxhXY
    For more educational content on video game development, unity tutorials, and c# programming don't forget to subscribe!
    Chapters:
    0:00 Introduction
    0:37 Setup
    1:50 Visualizing the aim line
    4:52 Toggling the aim
    8:07 Adding force to the ball
    11:15 Resolving a Physics timestep issue
    11:41 Outro
    ········································­­·······································­·­····
    ****
    Get a 90% discount on a .fun domain for one year on www.get.fun using the coupon “AIA”
    ****

    #unity3d #unitytutorial #gamedev

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

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

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

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

    Amazing video keep going :)

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

      thanks :)

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

    This its greath, thanks man!

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

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

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

    Simple and explained well

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

      Thank you!

  • @YoyoIsMeXD
    @YoyoIsMeXD 11 месяцев назад +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

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

    When are we getting part two? I am excited!

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

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

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

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

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

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

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

      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 11 месяцев назад +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...

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

    Awesome

  • @kioka2
    @kioka2 2 года назад +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  2 года назад +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 2 года назад

      ​@@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  2 года назад +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 2 года назад

      @@AIAdev Thank you man!

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

      haha was about to ask the same question

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

    Please make more parts to this

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

      I’m currently working on a next part :)

  • @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

  • @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 Год назад +2

      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 6 месяцев назад

      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

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

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

    • @YoyoIsMeXD
      @YoyoIsMeXD 11 месяцев назад

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

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

    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 4 месяца назад

      do you have any solution?

    • @SerinitySW
      @SerinitySW Месяц назад +1

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

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

    When's the next part?

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

      Next week :)

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

      @@AIAdev ok thanks