DRAG & SHOOT in Unity | 2D Game Dev Tutorial

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

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

  • @MuddyWolf
    @MuddyWolf  5 лет назад +50

    Was this tutorial useful? Would you like more tutorials on the elements of games I make?

    • @Luckysury333
      @Luckysury333 4 года назад +1

      YES IT WAS SUPER USEFUL!!! Can you make a video where we can see where the ball is going to head if we pull like those dotted line in Angry Birds??

    • @MuddyWolf
      @MuddyWolf  4 года назад

      Hmmm, yes maybe I will do a trajectory line video !

    • @Luckysury333
      @Luckysury333 4 года назад +1

      @@MuddyWolf I am getting ready for Ludum Dare 46 this 17th of April.....hope you will be also joining (in case if you don't know what is ludum dare, it is one of the world's largest game jams search google for more info)

    • @MuddyWolf
      @MuddyWolf  4 года назад +1

      @@Luckysury333 I am this will be the first one I join. To be honest I'm not the best at game Dev! I'm trying to get better but practicing then showing off what I learn in a tutorials for others!

    • @utsavsingh1128
      @utsavsingh1128 4 года назад +1

      @@MuddyWolf Yes trajectory line video would be great.

  • @TheCodeFreak
    @TheCodeFreak 5 месяцев назад +3

    Absolutely nailed it! Even after 4 years, this is such a gold tutorial. You earned yourself a like and a sub

    • @MuddyWolf
      @MuddyWolf  3 месяца назад

      Awesome, thank you!

  • @TurkishiOSGaming
    @TurkishiOSGaming 4 года назад +6

    You are a great teacher. You got everything; fun, educative and not boring...

  • @CodeBlues-TimeisGold
    @CodeBlues-TimeisGold 3 года назад +3

    It's a 3D project, but we can change the z value to y value. Thank you very much for making a very useful tutorial. I wish you happiness.

  • @Luckysury333
    @Luckysury333 4 года назад +6

    This is an underrated Channel for sure here you are gifted with a sub

    • @MuddyWolf
      @MuddyWolf  4 года назад

      Thank you! I've started to put in works for future videos. A devlog will be on the channel tomorrow! :D

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

    Damn dude you make awesome tutorials! Idk why you dont have more subs

  • @craezyfx608
    @craezyfx608 4 года назад +4

    You are very underrated! This is very helpful. Thank you.

  • @Катюша-щ5ю
    @Катюша-щ5ю 2 года назад

    I can't thank you enough, it works, figured the first time didn't work because I got some lines wrong

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

    On dragging it actually control the ball throwing force like( if mouse dragging length is short the force applied on the ball is low competitive the longer drag).

  • @mehrshadeftekhari6009
    @mehrshadeftekhari6009 4 года назад +1

    Amazing.👌
    I was using it for a touch-controlled game and change a few things in there.
    but anyway the Explanations were really good(others won't say which code is doing what or what is this line of code
    we are writing is for.
    I mean we learn it as you do it cause u explain everything, and we are not just copying everything you type without being able
    to configure it for our own game later or understand it.
    tnx a Lot.😊

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

    Awesome tutorial.
    First thing i will try tomorrow morning after my round of golf.

  • @xliquid1400
    @xliquid1400 4 года назад +1

    thanks, man this video was awesome, slowly and good explained, you spoke clearly, and I could understand every word, unity tutorials should always be like this subbed :)

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

    OMG thank you so much, i've tried to do this for 3 days and finally it's working, thank you !

  • @Alex-eq2um
    @Alex-eq2um 5 лет назад +11

    14:54 😂😂😂 And great video by the way, really helped with my game.

  • @BarryConnolly-w2n
    @BarryConnolly-w2n 11 месяцев назад +1

    Lovely Turtorial precise and easy to follow !!

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

      Glad you liked it!

  • @arthur-monteath
    @arthur-monteath 4 года назад +2

    this channel is incredible

    • @megames4521
      @megames4521 4 года назад +1

      It's sad he didn't post for 4 months.. :/

    • @MuddyWolf
      @MuddyWolf  4 года назад +1

      It's coming back! I'm coming back! Woop!

    • @MuddyWolf
      @MuddyWolf  4 года назад +1

      More to come soon!

    • @megames4521
      @megames4521 4 года назад +1

      @@MuddyWolf Nice

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

    Also, anytime I drag and shoot and collide with 2 or 3 box collider platforms, the drag and shoot doesnt work. Any fix?

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

    Didn't use the whole tutorial, but was definitely very useful with working out how the line renderer works! Looking forward to watching more of your videos :)

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

    @muddywolfgames awesome tutorial. have just one doubt ,,,, how do i show the power when the player interacts with game. i mean at the start of the video 0:10 i can see there is a power at the top centre, how can i achieve this?

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

    Your video helped me to start developing a game that will be amazing. When I finish and upload it on steam you will get it for free.

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

      Have fun! I'm excited to see what you create! :D

  • @TheSaucerful
    @TheSaucerful 4 года назад +1

    İ have a problem;
    my line start from mid of the screen and lenght of line is very short. How can i locate close to the player and make it size longer?

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

    I've got error at 21:26 : There is no argument given that corresponds to the required formal parameter 'position' of 'LineRenderer.SetPosition(int, Vector3)'

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

      nevermind, I've writed lr.SetPosition(points); instead of lr.SetPositions(points);

  • @joshlim8595
    @joshlim8595 4 года назад +1

    Great tutorial! Explained really well and easy to understand

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

    Hello! Thank you very much for the tutorial! I'm having issues when I set the camera to perspective mode. It only works correctly if it's in orthographic mode. Has anyone else experienced this? How can I solve it?

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

    so i was wondering, how do you make it so you can only use it a certain amount of times when you are in the air and when you touch the ground it resets?

  • @prabinadhikari3037
    @prabinadhikari3037 5 лет назад +1

    hello,how can i make the line follow the camera?
    so,i am making the game where the camera follow the gameobject..when ever i try and draw the line ,the startpoint moves off the camera and i dont want this to happen...i want to follow the camera like ur game which shows at beggining ..please help

  • @rubikscube6771
    @rubikscube6771 4 года назад

    Wow, thanks. That is one of the best tutorials i have ever seen:)

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

    hello, could you make an example of a game similar to ddtank, where you have the aim and strength to shoot?

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

    This was definitely useful. Thanks a lot for creating this tutorial.

  • @FlimzyYT
    @FlimzyYT 2 года назад +8

    If you want to make it so you can only drag when the object is still, Then the DragNShoot script will be this:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class Movement : MonoBehaviour
    {
    public float power = 10f;
    public Rigidbody2D rb;
    public Vector2 minPower;
    public Vector2 maxPower;
    TragectoryLine tl;
    Camera cam;
    Vector2 force;
    Vector3 startPoint;
    Vector3 endPoint;
    bool isStill = true;
    private void Start()
    {
    cam = Camera.main;
    tl = GetComponent();
    }
    private void Update()
    {
    if (rb.velocity == new Vector2(0, 0))
    {
    isStill = true;
    }
    else
    {
    isStill = false;
    }
    if (Input.GetMouseButtonDown(0) && isStill == true)
    {
    startPoint = cam.ScreenToWorldPoint(Input.mousePosition);
    startPoint.z = 15;
    }
    if (Input.GetMouseButton(0) && isStill == true)
    {
    Vector3 currentPoint = cam.ScreenToWorldPoint(Input.mousePosition);
    currentPoint.z = 15;
    tl.RenderLine(startPoint, currentPoint);
    }
    if (Input.GetMouseButtonUp(0) && isStill == true)
    {
    endPoint = cam.ScreenToWorldPoint(Input.mousePosition);
    endPoint.z = 15;
    force = new Vector2(Mathf.Clamp(startPoint.x - endPoint.x, minPower.x, maxPower.x), Mathf.Clamp(startPoint.y - endPoint.y, minPower.y, maxPower.y));
    rb.AddForce(force * power, ForceMode2D.Impulse);
    tl.EndLine();

    }
    }
    }
    Here I created a bolean called "isStill".
    And in the void Update() I made isStill = true if the velocity of the rigid body is = new Vector2(0, 0)
    And if its not (else), then isStill = false.
    And then for each if statement we made I added (&& isStill ==true) to make sure the object is still to be able to perform this action

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

      hi, how can i do this in 3D? what would be the code? sorry to bother you my friend.

    • @redtriangle920
      @redtriangle920 21 день назад

      holy shit dued, thank you

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

    idk if you are gonna respond to this because it's been 2 years sience you made this video
    but the tutorial is great i just have an issue with it: the players can spam it and they can fly so how do i make like a cooldown system or that if the player stops moving then they can move again or something?

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

      So what I did was create a boolean variable to track whether the player has used their drag and shoot ability or not. I wanted the player to have one chance to use the drag and shoot function and thats it. And when the player respawns it re-enables it.
      bool hasShot = false;
      if (Input.GetMouseButton(0) && !hasShot)
      if (Input.GetMouseButtonUp(0) && !hasShot)
      {
      hasShot = true;
      }
      Then, in my respawn Coroutine I just added
      hasShot = false;
      so for you, I would recommend doing like a Coroutine WaitForSeconds and then setting the boolean variable back to false or something of that nature.

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

    My left ear really enjoyed that one

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

    Thank You! That's exactly what I need
    Greets Dominik

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

    thank you so much Muddy Wolf games. This was really helpful for me!

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

    Great Tutorial! But unfortunetly it didn't work for me but you know it's okay, It was good explaining and atleast i learned alot with input, Thank you!

  • @3Fingrd
    @3Fingrd Год назад

    Followed the video and on finish the line renderer seems like it's attached to the ball object, so when i drag it spawns the line next to the ball rather than where I click. Did I miscode it or miss box tick in a menu or something?
    Either way awesome video :) thanks for putting it out

  • @mistercoder6594
    @mistercoder6594 4 года назад +1

    Exactly what i was looking for, thank you so much :)

  • @OAAA.1
    @OAAA.1 3 года назад +1

    How to make it limited like 3 shots then its gameover

  • @skamzababy6017
    @skamzababy6017 4 года назад +1

    lovely video mate

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

    I just don't understand what's the first parameter in the Mathf.Clamp( ) function and I don't get the use of it. Otherwise, everything else is clear.
    Thank You!

  • @AveryLiligant
    @AveryLiligant 4 года назад

    Thank You for this tutorial. It was very useful and well produced too :)

    • @MuddyWolf
      @MuddyWolf  4 года назад

      You're very welcome!

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

    Dummy question here: I have a ball with 9 child bones( to create the soft body effect). Initially, the script applied only to the rigid body "Ball" had no effect, so I've added the same script also to each bone and it works perfectly. With that said, is there another way of doing it? Not sure if that's the most lean way. Thanks

  • @VoderPoint
    @VoderPoint 10 месяцев назад +1

    everyone i know im late to the party but i need help i followed everything but unity says "The type or namespace name 'TrajectoryLine' could not be found (are you missing a using directive or an assembly reference?)" pls help me ive been stuck for two days !

    • @Diogo-md7rb
      @Diogo-md7rb 9 месяцев назад

      it's because of how the LineRenderer script is named, probably your script was not named "TrajectoryLine", try it out

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

    When I try to add another line renderer for my player to make it so it has a trail while its moving and its not working. Does anyone know how to fix this?

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

    i want to add cooldown for this shooting thing. please answer and tell us how we can add cooldown for this game please
    Cheers
    -your lovely followers :)

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

      There's 2 ways you can do this! Either a by using coroutine function or by setting a boolean and setting it true after a timer, I would recommend looking into coroutines!

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

      @@MuddyWolf i didnt understand that how can i do cooldown with using coroutine system. Can you show me one video that shows how can i add cooldown to my game using coroutine system please? I tried a lot of tutorials but they didnt work.

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

    Great Vid! But is there a way you can drag and shoot once until you hit the ground so you won't keep shooting up in the air?

    • @d.r1775
      @d.r1775 3 года назад

      with a bool variable check if the ball is on the ground. or if collide with the boxcollider.

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

    Hey man, I've really liked your tutorial and it helped me a lot; but can you help me with something? After I added animation to the script the ball only jumps straight in the air, it doesn't jump on the right or left part, do you know any solution for this? Thanks in advance!

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

    Im getting null reference on line 39 and 49 in DragNShoot script

  • @rapizer3427
    @rapizer3427 5 лет назад +1

    This tutorial is extremely helpful thanks a million!

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

    Thank You For The Tutorial! I Am Working On A Stickman Game And With This I Can Make It Have Unique Movement

  • @crazy5948
    @crazy5948 4 года назад

    absolutely amazing exactly what i was looking for thank you

  • @mr.waddles2027
    @mr.waddles2027 3 года назад

    Hey excellent video but I have a question
    How do you get the autocomplete and definition thing for unity because when I type it doesn't show all the options you have

  • @Isica223
    @Isica223 4 года назад

    Nice video! thanks, but how can i make the line attached to the ball?, if i disable use world space, still the line render where i got the mouse.

  • @rubikscube6771
    @rubikscube6771 4 года назад

    I have a problem with the code:(
    Unity says no errors but when i just click without dragging it applys velocity on the y axis:( Can you/someone please help.

  • @tamla9875
    @tamla9875 4 года назад

    Hi, how can I make trajectory line that predict the path that the object will travel? Like angry bird. Also please make a tutorial on Archery game.

  • @Dubutofuuuuuu
    @Dubutofuuuuuu 9 месяцев назад

    where did ub get the shapes from

  • @hamster6039
    @hamster6039 4 года назад

    How could i make dots, so before shooting , i know how object would fly

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

    Im making bow shooting game.How i can rotate my bow in the right direction with this script?

  • @Jack_gav
    @Jack_gav 4 года назад +1

    Just wondering, how would I go about setting the start point to an object e.g. the ball instead of a camera point? So that my drag starts from the object, thanks so much! Great tutorial

    • @thebonbadoor108
      @thebonbadoor108 4 года назад +1

      You could use a raycast from mouse position and check for collision on an object by tag

  • @hellclown210
    @hellclown210 4 года назад +1

    Amazing tutorial , Thank you so much !!!

    • @MuddyWolf
      @MuddyWolf  4 года назад

      Glad you enjoyed it!

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

    Ive 1 to 1 followed the tutorial. The ball doesnt shoot. Help

  • @reya.9915
    @reya.9915 3 года назад

    Awesome tutorial!

  • @DiuNeiMeeh
    @DiuNeiMeeh 5 лет назад +2

    thank you so much for the tutorial, I'm trying to make the line renderer start from ball instead of my mouse point when i drag anywhere of the screen and the line will expand the opposite way, can you pls advice.

    • @MuddyWolf
      @MuddyWolf  5 лет назад +1

      There is a setting on the line renderer component that says use world space, if you uncheck this the line will draw from the game object! I hope this helps!

    • @fallendagger2766
      @fallendagger2766 4 года назад +1

      @@MuddyWolf Yes it helps

  • @firatsezgin1289
    @firatsezgin1289 5 лет назад +1

    I am thankfull to reddit for sending me to you

    • @MuddyWolf
      @MuddyWolf  5 лет назад +1

      Woo, I'm happy you came! I hope you enjoy your stay! 😁

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

    What if I want to check is gameObject still? (Cant shoot mid air)...

    • @FlimzyYT
      @FlimzyYT 2 года назад +2

      Then the DragNShoot script will be this:
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class Movement : MonoBehaviour
      {
      public float power = 10f;
      public Rigidbody2D rb;
      public Vector2 minPower;
      public Vector2 maxPower;
      TragectoryLine tl;
      Camera cam;
      Vector2 force;
      Vector3 startPoint;
      Vector3 endPoint;
      bool isStill = true;
      private void Start()
      {
      cam = Camera.main;
      tl = GetComponent();
      }
      private void Update()
      {
      if (rb.velocity == new Vector2(0, 0))
      {
      isStill = true;
      }
      else
      {
      isStill = false;
      }
      if (Input.GetMouseButtonDown(0) && isStill == true)
      {
      startPoint = cam.ScreenToWorldPoint(Input.mousePosition);
      startPoint.z = 15;
      }
      if (Input.GetMouseButton(0) && isStill == true)
      {
      Vector3 currentPoint = cam.ScreenToWorldPoint(Input.mousePosition);
      currentPoint.z = 15;
      tl.RenderLine(startPoint, currentPoint);
      }
      if (Input.GetMouseButtonUp(0) && isStill == true)
      {
      endPoint = cam.ScreenToWorldPoint(Input.mousePosition);
      endPoint.z = 15;
      force = new Vector2(Mathf.Clamp(startPoint.x - endPoint.x, minPower.x, maxPower.x), Mathf.Clamp(startPoint.y - endPoint.y, minPower.y, maxPower.y));
      rb.AddForce(force * power, ForceMode2D.Impulse);
      tl.EndLine();

      }
      }
      }
      Here I created a bolean called "isStill".
      And in the void Update() I made isStill = true if the velocity of the rigid body is = new Vector2(0, 0)
      And if its not (else), then isStill = false.
      And then for each if statement we made I added (&& isStill ==true) to make sure the object is still to be able to perform this action

  • @keremaslan1988
    @keremaslan1988 4 года назад

    How can i instantiate an object in the trajectory lines direction? Can anyone help?

  • @cameronmiller4958
    @cameronmiller4958 4 года назад

    i keep getting error code cs1061 for the drag and shoot code and i dont know how to fix it
    can anyone help

  • @omersatran6700
    @omersatran6700 5 лет назад +2

    does it work for mobile?

  • @TiimedArts
    @TiimedArts 4 года назад +1

    exactly what i was looking for

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

    nice tutorial, but how about on a 2d project with perspective camera?

  • @donutbedum9837
    @donutbedum9837 4 года назад +1

    Bro hell yeah this was useful. This is like the first thing I've ever done that works. Definitely subbing and watching your other videos.
    Can we have the source code? Thx!

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

    this didn't work for me and i have no idea what to do he tell me the cam doesn't exist

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

    Yeah it works! However, it isnt accurate for me. Any idea why?

    • @MuddyWolf
      @MuddyWolf  4 года назад

      Hmmm, I'm not sure without seeing it

    • @unscriptedlogicgames
      @unscriptedlogicgames 4 года назад

      @@MuddyWolf To give u an idea of what i was doing, i created a "Prediction line" which basically draws an arrow in the opposite direction using the Line renderer. But when I shoot the ball, the ball's final trajectory isnt the same.

    • @unscriptedlogicgames
      @unscriptedlogicgames 4 года назад

      @@MuddyWolf In the end i resorted to the spring joint in unity. I used the spring joint for the pullback and just disabled it once it reaches the pivot point which works similarly to your video. Thanks a bunch anyway!

  • @DarkDragonBloody
    @DarkDragonBloody 4 года назад +1

    Nice Video man

  • @fallendagger2766
    @fallendagger2766 4 года назад +1

    will this work for 3D the "Drag code"?
    thank you

    • @MuddyWolf
      @MuddyWolf  4 года назад +1

      I haven't tested it to be honest!

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

    First, thank you for this awesome Tutorial!!^^
    Why do you use Vector3 for startPoint and endPoint? What can be a problem with Vector2?

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

      Because he wanted the line to be shown if it was Vector2 you cannot change the startPoint.z which he did in the video 11:00

  • @giannisroumeliotis4142
    @giannisroumeliotis4142 4 года назад +1

    is there a way you can tell me how to change it instead of mousebutton to touch, for mobile uses, thank you :)

    • @MuddyWolf
      @MuddyWolf  4 года назад +1

      Hi! I'll make a drag and shoot with mobile touch controls sometime today.

    • @giannisroumeliotis4142
      @giannisroumeliotis4142 4 года назад +1

      @@MuddyWolf great! thank you so much

    • @MuddyWolf
      @MuddyWolf  4 года назад +1

      Recorded, edited, uploading be out by 2/2:30 BST today

    • @giannisroumeliotis4142
      @giannisroumeliotis4142 4 года назад

      @@MuddyWolf great! cant wait

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

    Great video - thanks!

  • @codedontwrk1132
    @codedontwrk1132 5 лет назад

    When i drag nothing comes up what should i do??

  • @overgeared2014
    @overgeared2014 5 лет назад +4

    I didn't work for me, when i drag nothing happens
    Edit: Figured it out, for those of you who also have the same problem, change the second if statement to something like the one below
    if (Input.GetMouseButtonUp(0))
    {
    endPosition = cam.ScreenToWorldPoint(Input.mousePosition);
    endPosition.z = 15;
    //sometimes the object will move even when you click so i made a new if statement
    //so object won't move unless you've dragged the mouse a more than 2 units
    if ((startPosition - endPosition).magnitude > 2f || (startPosition - endPosition).magnitude < -2f)
    {
    mforce = new Vector2(Mathf.Clamp(startPosition.x - endPosition.x, minPower.x, maxPower.x), Mathf.Clamp(startPosition.y - endPosition.y, minPower.y, maxPower.y));
    rb.AddForce(mforce * power, ForceMode2D.Impulse);
    }

    }

    • @TiimedArts
      @TiimedArts 4 года назад +1

      What is the difference?? I have the same Problem, i exactly made it like him but it is not working for me...

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

      Muchos thank's amigo, llevaba un buen rato dándole vueltas y no savia que hacer, hasta que puse tu código.

  • @miuni824
    @miuni824 4 года назад +1

    can i get your desktop wallpaper please?

    • @MuddyWolf
      @MuddyWolf  4 года назад

      I don't have it anymore and don't remember where I got it from... Sorry!

  • @trkkkmatmat6070
    @trkkkmatmat6070 4 года назад

    Why my player jump in only y axis

  • @RajOnTheStreet
    @RajOnTheStreet 5 лет назад +1

    Really helpful! thanks for the tutorial!

  • @shaquilleoatmeal7412
    @shaquilleoatmeal7412 4 года назад

    14:54 "OHHH it's gone it's gone far and wide" 😃

  • @amandixit1779
    @amandixit1779 4 года назад

    It's awesome ..but I really need help cause something came up and I'm really frustrated...I have made all the colliders as mentioned in the video but still, my player(ball) falls out of the area...Meaning no collision...Please if anyone has the solution for this please do help.....

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

    The script worked but the effect would only show a dot

  • @skeep12
    @skeep12 4 года назад

    with TrajectoryLine is gave an error saying It could not be found, what happened?

    • @vatsalbhalani4554
      @vatsalbhalani4554 4 года назад

      Same problem, did you find a solution?

    • @skeep12
      @skeep12 4 года назад

      Vatsal Bhalani no :( I decided to not use the line at all, It was for testing anyway

    • @vatsalbhalani4554
      @vatsalbhalani4554 4 года назад

      Oh lol;-; I'm trying to make a line for a ball game just like this tutorial, maybe I'll have to watch multiple of them to get different ways of doing it

    • @keremaslan1988
      @keremaslan1988 4 года назад

      @@vatsalbhalani4554 did you solve the problem ?

  • @mahmoudshalabi8613
    @mahmoudshalabi8613 4 года назад

    Hey! Could this be used in 3d

  • @Muthugaming843
    @Muthugaming843 4 года назад +1

    Hey bruh how to do you learn unity
    can you share somethings to us......................

    • @MuddyWolf
      @MuddyWolf  4 года назад

      I just read the documentation! It's really useful!

  • @khalidmokhliss3820
    @khalidmokhliss3820 4 года назад

    heemmmmm why the ball do not move in my variant

  • @keremaslan1988
    @keremaslan1988 4 года назад

    My trajectory line doesnt work can someone help please?

    • @xteclisx27
      @xteclisx27 4 года назад

      Gotta expound a bit my dude.

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

    Dude you've helped me so much for this upcoming game jam! Thank you so much! Sub +1

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

    Force = Vector2(Mathf.Clamp(startPoint.x - endPoint.x, minPower.x, maxPower.x), Mathf.Clamp(startPoint.y - endPoint.y, minPower.y, maxPower.y));, this is and error it says u cant use VEctor 2 like a method.

  • @greengamer2065
    @greengamer2065 4 года назад

    it not showing ridgidbody in code

  • @alexrizzo__93
    @alexrizzo__93 4 года назад +1

    Thank you!

  • @ezekielthemack
    @ezekielthemack 4 года назад +1

    Sit back grab your snacks - love it. LOL

  • @MohamedHassan-tp2tf
    @MohamedHassan-tp2tf 5 лет назад +2

    Thank You so much

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

    very helpful

  • @TobySullivan
    @TobySullivan 4 года назад +1

    oh thats pretty epic

  • @bitmodelstudio
    @bitmodelstudio 4 года назад

    how can i prevent multiple jumps?

    • @clumsycaden5708
      @clumsycaden5708 4 года назад

      yeah, make a boolean thats called in air. If it is in the air change the boolean to true. Make an if statement "if (boolean) is true" and pause the movement when its true

    • @bitmodelstudio
      @bitmodelstudio 4 года назад

      @@clumsycaden5708 thx. i fixed already. 👍😀

    • @clumsycaden5708
      @clumsycaden5708 4 года назад

      @@bitmodelstudio oh ok, I thought so since you commented 2 weeks ago