Unity 5 - Grab and Throw Objects

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

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

  • @wes7104
    @wes7104 2 года назад +5

    Dude I'm so grateful for you I have been stuck on this for weeks and you helped me so much. I subbed, turned on notifications and liked you video. Thanks So Much!!!!

  • @beaujanssen6243
    @beaujanssen6243 6 лет назад +24

    this works perfectly, even 2 years after the making of this video, youre still helping people out with this. thanks a lot!

    • @2kmixedit
      @2kmixedit  6 лет назад +7

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

      Which player controll system you use, please drop the script.

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

      Even 4 years after the making of this video, you're still helping out alot!

  • @tohasim9159
    @tohasim9159 4 года назад +8

    Hey, I know this is old, but couldn't you move the HasPlayer check in after the "Use" button check, that way you wouldn't check distances every frame, just whether the use button has been pressed

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

    Thank you SO much for the public script, works perfectly, easy to understand and edit! life saver.

  • @2kmixedit
    @2kmixedit  8 лет назад +17

    The entering&exiting vehicles v2 video is next for everybody who's having troubles with it.

    • @jaxthemodder1773
      @jaxthemodder1773 8 лет назад

      Lurony you should make one on how to make a vehicle

    • @2kmixedit
      @2kmixedit  8 лет назад

      I have a whole video on making a character and rigging them the easiest way possible and importing them to unity so you can use them with the unity standard assets third person controller prefab like you saw in my previous videos.

    • @Εδουάρδοςόμορφος
      @Εδουάρδοςόμορφος 7 лет назад

      sir can you make script for paper toss? please using unity engine

    • @banana4ever561
      @banana4ever561 7 лет назад +1

      ArgumentException: Input Button Use is not setup.
      To change the input settings use: Edit -> Project Settings -> Input
      ThrowObject.Update () (at Assets/scripts/ThrowObject.cs:32)

  • @R-SXX
    @R-SXX 6 лет назад +3

    Hello! Great tutorial, but I stumbled upon an error and I, as a newbie, am not able to fix i... may you help me please? Everytime I want to grab an object, it slightly moves, but nothing else happens - but I get an Array index is out of range error. Unity says, the error lies within the audio-line so i deleted it, and now, I do not get any errors, but I am still not able to pick anything up - my crate wubbles a little and thats it. :(

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

    Can somebody help me because I don't want object to fall down when it hit something and I also don't want it to go through walls. I wont it to stay in front of wall while still being attached to a player. Help please :(

  • @jimmyahlvik2286
    @jimmyahlvik2286 6 лет назад +3

    I have a problem! I don't use the FPSController so when i grab the object and move it, the object changes scale. what should I do?

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

      Did you figure it out? I also have this problem :

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

      Me too

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

      @@thebigcheese1153 it's probably because the FPSController is not scaled equally on every axis, if you set the scale to 1 on x, y and z then it should stay the same

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

      @@jimmyahlvik2286 Thanks, that was the problem indeed.

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

    i get the error "Input button "Use" is not setup. does anyone know how to set up an input button for the "use" function?

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

    The object is clipping through walls and other rigid bodies. Any help?

  • @matthewarturo8040
    @matthewarturo8040 6 лет назад +1

    Ok so i added the object, then added a rigidbody and a second collider to it set to "is trigger".
    I added the script to the object and set my player and camera in the inspector.
    I added the input control called "Use" and set it to "e". I added the audio and set it in the script section.
    However I still can't seem to get it to work. I don't get the pointer thing that is on your screen in the video.
    Any idea what I might be doing wrong? Did I miss a step?

    • @2kmixedit
      @2kmixedit  6 лет назад

      The pointer thing is a part of the UI just create an image, center it, set the anchors to be in the center.

  • @faloed1
    @faloed1 7 лет назад +1

    Bro, I have tried your script but making some changes like using the transform of the player instead the PlayerCam (on the transform.parent) 'cause in my case a have an Character on the game. The thing is I can't make the object be right in front of him (even in the Position and Rotation). Do you have any ideia or tip to help me?? Thanks, by the way...

  • @GreekGamerJim
    @GreekGamerJim 7 лет назад +1

    When there are 2 objects that meet the distance criteria it grabs both. How would you only grab the one you want using a raycast?

  • @lill.johnysparkour
    @lill.johnysparkour 4 года назад +1

    What part of the code gets the object drop when it collides with a wall? I want to use the collision part in my own script, can you explain what I can do?

  • @BojanVasilev
    @BojanVasilev 6 лет назад

    i can't find the code somebody help me

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

    how to have 1st person camera like you did. Mine doesn't have that kind if pointer..

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

      Canvas + 2d sprite image

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

    Hello i have a save system and object dont' load in the correct position can you please see project?

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

    Thank you so much for this video! I've used some of the code from this script but I implemented this feature into my own interaction system and it works well! Thanks!

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

    Doesn't seem to "pick" up the object every time. If I move around it a bit, and spam Use it eventually does. Any way to fix this?

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

    how do you make the input settings work?? no matter what i do i cant pick it up with any key

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

    This is how I sound when talking about game development glad to see I'm not alone 😂

  • @raba4646
    @raba4646 7 лет назад +1

    Very nice script, I've rarely seen a such simple way of grabbing objects.
    This said, it do lack of a little something, like some laziness.
    I know it have something to do with Spring Joints, but I can't figure where to start to implement this...

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

    I could throw the object but I cant pick it up, Can you help me fix this please?

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

    if you have two objects you pick them both up. this can cause some crazy stuff to happen.

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

    does anyone know how to stop it picking up more than one object at once?

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

      Did you ever solve this? Im trying to pick up a rope without all of the nearby parts becoming kinematic

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

      @@eddiequeboard2672 no i didnt sorry

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

    Does this work also to drag other players like in gang beats?
    And can i modify it so that only when the player is drowning is the other player able to drag him?

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

    Hey! Idk if you still come here or if anyone will even see this comment, but for some reason when I try to pick the object up, it only works sometimes. And sometimes the object will even be put on my camera, but then will get taken right back off.

  • @chadm6777
    @chadm6777 8 лет назад +1

    +Lurony Looking forward to seeing what changes you implemented in v2 entering and exiting vehicles :)

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

    Just wondering. When you put this code in, what button do you click to lift the object?

  • @danieldixon8011
    @danieldixon8011 6 лет назад

    Whats the cube thats parented to the camera? When I pair my object to my fps it just moves with it...

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

    Since the object drops and unparents when colliding with something, wouldn't the object always drop when you attempt to pick it up because the object is colliding with the ground?

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

      Depends on the size of the player and the collider, so when you look down to pick it up , if its small it'll work but if its really big it'll work rarely. i reccomend removing that part of the code.

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

    Very well explained !! thanks a lot

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

    Would you (or anybody reading this) be able to explain the measurement 'f' used for distance? I've never seen it used before and can't seem to find any explanations anywhere online.

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

      It's not a measurement, f is used next to a decimal number to let unity know that it's a float (decimal number) and that the comma ( , ) between numbers represent the decimal numbers. By default numbers are integers so if I would put 2,5 without the f Unity would think that I'm giving multiple numbers (2 and 5) but if I put 2,5f it now knows that it is one number with a decimal.

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

      @@2kmixedit Oh, interesting. Thank you! : )

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

    witch button you use to grab

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

    I'm very new to game dev trying out self learning.
    ive downloaded the zip file put the throwobject c# into my project i put a cube down and put a box colliderx2 one with trigger one without and a rigidbody with the script added my player/player cam and ive got an argument exception (input button use is not setup) where could i find that?
    EDIT: Its telling me to go into edit -> settings -> input . but it doesn't tell me where to change the input key?
    Plus how do i add a grab icon on my screen when i hover over a grab object?

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

      You can find the answer to your first question in the comments and reply below.
      Goto Edit>Project Settings>Input. You can create a new input and set the Name "Use" , or changed Fire2 to "Use" . Then set the positive button to 'e' or whichever one you want. You pick it up by pressing e, throwing it with left mouse button and drop it with the right mouse button

  • @lewisbirkett4428
    @lewisbirkett4428 7 лет назад

    It works with a first person controller but with my game I'm using a custom thirdpersoncontroller with a navmesh so it doesn't pick the object up just does the kinematic change, I'm not sure how I'd make it work with this setup

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

    Is there a way to make sure that the object that i pick up is always floating on my right side, like it is my right hand?

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

    I have no idea what I'm doing wrong, none of these tutorials work for me. and I don't understand where I change the "Use" input to "E"

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

    Something I've been looking for a very long time, how did you make objects have these lines around them? And thanks for the video! It helped a lot.

  • @ibiixie
    @ibiixie 7 лет назад

    How would I go about actually applying a realistic velocity to the object when for example you carry it using the mouse pointer, and let the item go as your moving the mouse?
    In real life this would of course throw the object away in a velocity relative to the speed of the mouse, however in Unity this just drops the object so it falls straight down.

    • @2kmixedit
      @2kmixedit  7 лет назад

      Maybe make a float that detects the speed of the mouse and when you let go a button apply that force in the direction where the mouse was going to the object that you picked up, and just pick it up by detecting if the mouse is on the object or not

    • @ibiixie
      @ibiixie 7 лет назад

      Lurony How would I go about checking the direction? I alteady tried doing that, but I guess I must have gotten the maths wrong somewhere...

  • @NiksTV99
    @NiksTV99 6 лет назад

    ArgumentException: Input Button Use is not setup.
    To change the input settings use: Edit -> Project Settings -> Input
    what i need there? PLEASE HELP

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

      you don't have your inputs set up, go to project edit>settings>input and create an input for use. Look up how to set up input if you get stuck.

  • @solidslish2279
    @solidslish2279 6 лет назад

    Can someone explain what changes I need to make to the script that wasnt shown in the video? I added the script to the box, the fps stuff to the script, player tags, both box colliders and still nothing is working

    • @2kmixedit
      @2kmixedit  6 лет назад

      Everything is shown in the video, try rewatching.

  • @avinashtiwari9005
    @avinashtiwari9005 6 лет назад

    how to make an animated model throw a rigid body? please help

  • @banana4ever561
    @banana4ever561 7 лет назад

    The referenced script on this Behaviour (Game Object 'mediumBox') is missing!

  • @peytonfaz
    @peytonfaz 7 лет назад

    Hey does anyone have a tutorial on how i can use a fixed joint to pick up an object. I've been working on it all day, but can't get it.

  • @310thebank
    @310thebank 8 лет назад

    what button to hold or throw it

    • @2kmixedit
      @2kmixedit  8 лет назад +1

      Make a input called Use and set the positive button to E, you pick it up by pressing e throwing it with left mouse button and drop it with the right mouse button

  • @Serways
    @Serways 7 лет назад +2

    Hi this is a great tutorial, but i have having two problems, 1. if i get too close to an object i automatically pick it up 2. is there a way to force the location of the picked up object? (so the picked up object is always 0,0,-1 away from player)

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

    wich button do i press? i am confused
    edit: ok i figured it out but unity says "Input button use is not set up" halp

  • @Sir_Panicaim
    @Sir_Panicaim 7 лет назад +1

    quick tip:
    when you past
    if (beingCarried)
    {
    if (touched)
    {
    GetComponent().isKinematic = false;
    transform.parent = null;
    beingCarried = false;
    touched = false;
    }
    if (Input.GetMouseButtonDown(0))
    {
    GetComponent().isKinematic = false;
    transform.parent = null;
    beingCarried = false;
    GetComponent().AddForce(playerCam.forward * throwForce);
    RandomAudio();
    }
    else if (Input.GetMouseButtonDown(1))
    {
    GetComponent().isKinematic = false;
    transform.parent = null;
    beingCarried = false;
    }
    }
    and copy it infront of
    if (hasPlayer && Input.GetButtonDown("Use"))
    {
    GetComponent().isKinematic = true;
    transform.parent = playerCam;
    beingCarried = true;
    }
    and change Use to "mouse 0"
    you can pick it up with mouse 0 and when you press it again to throw it with mouse 0.

  • @merkistu
    @merkistu 7 лет назад

    Hello if i want to pick up an object with a robot gripper what should the code look like ? I am new to this :-D

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

    nothing happens when i put the script in and try to pick up a box

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

    Bro, this objects not come to with me. I take it in my hand, but it doesn't come with me.

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

    for some reson im not able to pickup the object :(

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

    i don' know if you still responding for comments but i will try your script is fully working for me but i wanna ask you why when i pick up object third time it will my object disappear? thanks

  • @dragosrose
    @dragosrose 7 лет назад +5

    Thanks for this tutorial!! But still I've got one problem. Every time when I grab the object (a sphere in my case), it's modifying its form (whenever i grab the sphere it is getting wider, until it's going to look like an ellipsoid). What is it causing this to happen?

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      It's a problem with the model it's getting skewed, try making any empty game object a parent of the sphere and picking that up

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      Copy all of the components from the sphere and add them to the empty parent, delete the components of the sphere.

    • @dragosrose
      @dragosrose 7 лет назад +1

      okay, tried it. Ball isn't deforming anymore, but i cannot lift it.

    • @dragosrose
      @dragosrose 7 лет назад

      this is what i call progress = )))

    • @dragosrose
      @dragosrose 7 лет назад

      Uptade: It actually worked!!,now i realise adding the script to that empty game object actually makes it work! Thank you

  • @AndaresDeathmask
    @AndaresDeathmask 7 лет назад +1

    Very good for my project, thank you

  • @prathimags8192
    @prathimags8192 6 лет назад

    i'm unable to pick up the object . i copied the script from the website. could someone help me

  • @banana4ever561
    @banana4ever561 7 лет назад

    ArgumentException: Input Button Use is not setup.
    To change the input settings use: Edit -> Project Settings -> Input
    ThrowObject.Update () (at Assets/scripts/ThrowObject.cs:32)

    • @2kmixedit
      @2kmixedit  7 лет назад

      You haven't set up the Use button in the input settings.

    • @banana4ever561
      @banana4ever561 7 лет назад

      Lurony can u help me? I'm at school now, but when i go home, i want to continue my game...thx!

    • @banana4ever561
      @banana4ever561 7 лет назад

      IndexOutOfRangeException: Array index is out of range.
      ThrowObject.RandomAudio () (at Assets/scripts/ThrowObject.cs:69)
      ThrowObject.Update () (at Assets/scripts/ThrowObject.cs:53)

    • @banana4ever561
      @banana4ever561 7 лет назад

      i dont now how to fix it.i need audio effect?

    • @banana4ever561
      @banana4ever561 7 лет назад

      please help :(

  • @DiYYoJmJAKDSiumoA
    @DiYYoJmJAKDSiumoA 7 лет назад

    hi one question how to make the use function?? srry just switched from leadwerks to unity help me pls

    • @2kmixedit
      @2kmixedit  7 лет назад

      You mean the Use input? Go to your project settings, then input inside the Unity editor and create a new input, call it "Use" and set the positive button to whichever one you want.

    • @DiYYoJmJAKDSiumoA
      @DiYYoJmJAKDSiumoA 7 лет назад

      srry but there is no option for me to add a new input help?

    • @DiYYoJmJAKDSiumoA
      @DiYYoJmJAKDSiumoA 7 лет назад

      i got the use function to work but if i pic someting up i glitch i cant move or my player freezes you know the problem?

    • @DiYYoJmJAKDSiumoA
      @DiYYoJmJAKDSiumoA 7 лет назад

      never mind fixed it thanks for the script

    • @2kmixedit
      @2kmixedit  7 лет назад

      Probably an error with the colliders.

  • @mantaskreivys1154
    @mantaskreivys1154 7 лет назад

    hello i have problem with your script throw and grab:( say ArgumentException: Input Button L is not setup problem how to fixx??? plz helpppppp

    • @2kmixedit
      @2kmixedit  7 лет назад

      You haven't set up the input button for L

    • @mantaskreivys1154
      @mantaskreivys1154 7 лет назад

      ty help me :)

    • @mantaskreivys1154
      @mantaskreivys1154 7 лет назад

      impossible to change mouse button drop the object with e input?

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      Look up on using the input settings in Unity its really simple.

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

    Thank you so much omg this was an amazing tutorial! Exactly what I needed, I just had to tweak a few stuff but it works great! Yay! And its awesome how this is 4 years old yet it still works like a charm.

  • @ericcarlson8212
    @ericcarlson8212 7 лет назад

    I've gotten very close, but when I grab the object, it doesn't move! I see the "use gravity" box is getting toggled on the object when I hit "e" but that's it. Any help would be greatly appreciated! Great looking script!

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      Check the scene, does the object get parented to your player once you pick it up?

    • @ericcarlson8212
      @ericcarlson8212 7 лет назад

      I got it to grab and drop! Now I can't get it to throw. I added the script to the FPS controller but the use key doesn't do anything (I did set a use key in my Inputs to "r").

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      It should work if you copied my script, you can get it on github. Just watch the video again and see if something is wrong.

    • @ericcarlson8212
      @ericcarlson8212 7 лет назад

      I got closer! Now it is saying "array index is out of range" concerning this line of code: audio.clip = soundToPlay[Random.Range(0, soundToPlay.Length)];

    • @ericcarlson8212
      @ericcarlson8212 7 лет назад

      Nevermind, I got it to work!! THANK YOU SO MUCH for making this.

  • @financialpirate
    @financialpirate 7 лет назад +2

    I did everything as in tutorial but I still get this error ( I can enter game and do everything normal so I dont get what does this error mean)
    IndexOutOfRangeException: Array index is out of range.
    ThrowObject.RandomAudio () (at Assets/ThrowObject.cs:68)
    ThrowObject.Update () (at Assets/ThrowObject.cs:53)
    Btw amazing channel, Subscribed :)

  • @notanagger4861
    @notanagger4861 7 лет назад

    it does not work for me... is says: "cannot find script class" when i try to put the script on a object :/

    • @2kmixedit
      @2kmixedit  7 лет назад

      You have to name the script the same in the editor as in the mono develop class inside the script.

    • @notanagger4861
      @notanagger4861 7 лет назад

      OK thnaks :D

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

    Will this works with slamming animation ?

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

    How we can sort the objects?

  • @tomtapp5136
    @tomtapp5136 6 лет назад

    Please help I keep getting the error : input use is not set up.

    • @2kmixedit
      @2kmixedit  6 лет назад

      Go to your project settings find inputs and set them up.

    • @tomtapp5136
      @tomtapp5136 6 лет назад

      obviously, but i dont know how

    • @2kmixedit
      @2kmixedit  6 лет назад

      I will make a video about that soon but just go at the top of unity, you have project settings and inside them find Inputs, click the plus icon, name the input Use and set the positive button to e

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

    Works on unity 4.7?

  • @seddaouiyassine7814
    @seddaouiyassine7814 6 лет назад

    How did you make your mouse disapear?

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

      He used the standard assets fps controller which has a mouse lock

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

    the script is correct but when i test it out i cant grab my object

  • @bettaneza9453
    @bettaneza9453 7 лет назад

    Hello, nice video, but where is the script? The link you provide say that is not found in the github. Please I need this for my proyect, if is possible to fix the link? Thank you

    • @2kmixedit
      @2kmixedit  7 лет назад

      The script is on github it's called throw object.

  • @ghufronhasan1697
    @ghufronhasan1697 7 лет назад

    how this project working with kinect control ? thanks

    • @2kmixedit
      @2kmixedit  7 лет назад

      Hm, depends on the mouse look script you're using.

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

    i want to make a game like portal 2, but, i only know the basics of C#! (sorry for my bad english, i speak portuguese)

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

    Wouldn't it be better to use a raycast and check the tag of the object..but great video tho..

  • @sxmxuxxxlx7797
    @sxmxuxxxlx7797 7 лет назад +3

    'The referenced script on this behaviour (Game Object 'default') is missing!'what should I do?

    • @YuriNoirProductions
      @YuriNoirProductions 7 лет назад +1

      maybe attach the missing script like it tells you to do? :D

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

    Great tutorial rlly helpful!

  • @TheSwagGuy5000
    @TheSwagGuy5000 7 лет назад

    Is there a way to make it work on mobile games?

    • @2kmixedit
      @2kmixedit  7 лет назад

      Of course just search up the mobile inputs and edit the code.

  • @Darknesslayer
    @Darknesslayer 7 лет назад

    Exactly what i want, just i want you to like, write the script and show me how to do what you are doing

  • @kurekureci
    @kurekureci 8 лет назад +1

    please do tutorial on split screen!!!
    3D FPS

  • @PlasticzPS3
    @PlasticzPS3 8 лет назад

    Awesome video :) btw what key do i click to grab?

    • @2kmixedit
      @2kmixedit  8 лет назад

      Make an Input called Use and set the positive button to E, when you press E you pick up the obhect :)

    • @PlasticzPS3
      @PlasticzPS3 8 лет назад

      nothing happens when i click e :(

    • @enniodejonge9153
      @enniodejonge9153 7 лет назад

      Where can I find the ''input Settings'' to set my ''E'' Button as ''Use''

    • @2kmixedit
      @2kmixedit  7 лет назад +4

      You don't have to modify one that's already there, you might need Fire2
      because it's the right mouse button, you can create a new one and call
      it "Use" and just change the positive button to e.

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

    It doesn't seem to work for me in Unity 2019 ;-;

    • @Nuff.x
      @Nuff.x 4 года назад +1

      well im on 2020 and it works fine

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

      @@Nuff.x how did you get it to work

  • @bennettkrubakar2734
    @bennettkrubakar2734 7 лет назад

    dude lurony pls tell me how to get these naruto assets

  • @humafida7040
    @humafida7040 7 лет назад +1

    which key you used for throwing object?

  • @elyk140
    @elyk140 7 лет назад +1

    First, thanks for making this tutorial this was very helpful for someone that's trying to jump into programming. Thanks for walking through your code. I had a few questions:
    - How did you make it so when you clicked your Left Mouse Button that it threw the rock? Mine seems to just drop when moving.
    - Using the GetButtonDown("Use") is set for "e" for me, is there a way to make it so when I hit "e" again it will drop the item?
    - Do you have to put this script on any other gameObject to make the current held item drop when they collide?
    Thanks!

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      Hey I'm glad you liked it, to answer your questions, if you click the left mouse button and the object drops, it might be because your throw force is too low or the object is too heavy (look at the rigidbody component), if it just drops when you start moving you either copied the code wrong or didn't set everything up correctly (look at my github for the script)
      Yes play around with the if statements, but basically in the if statement check if the player is carrying the object (do this by a boolean) and if GetButtonDown("Use") and then follow with the code for dropping the object
      I don't think so

  • @no00ob
    @no00ob 6 лет назад

    Thanks gonna use this in my game

  • @nerogaming753
    @nerogaming753 6 лет назад +2

    Will this work with third person controller I want to know please

    • @2kmixedit
      @2kmixedit  6 лет назад +2

      Yes, might need some changes tho.

    • @nerogaming753
      @nerogaming753 6 лет назад +1

      What changes and also thanks for video

  • @chieclatinhyeu1988
    @chieclatinhyeu1988 7 лет назад

    Hi there. Great video, I look up in your website and there are 2 "pick up script". Both of them are for pick up money, not object.

    • @2kmixedit
      @2kmixedit  7 лет назад

      You aren't paying attention, the script is called ThrowObject you can clearly see that in the video, it is located on the website.

    • @chieclatinhyeu1988
      @chieclatinhyeu1988 7 лет назад

      Lurony hi, sorry i didnt write it clear. Yes i do see that the script is "ThrowObject". When i scroll down to the link that show all of the scripts from the website GitHub. I saw 2 pickup scripts that both specialize in pick up money. That was my question.

  • @lee1davis1
    @lee1davis1 7 лет назад

    Thanks for sharing your script.

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

    i saved the github page
    dont delete it :)

  • @skysplicer
    @skysplicer 7 лет назад

    channel is underated

  • @tedwilson5550
    @tedwilson5550 7 лет назад

    I can not find the assets, the links loop through the same pages and only show the scripts. Otherwise thank you for a good video.

    • @2kmixedit
      @2kmixedit  7 лет назад

      The scripts are the assets I didn't include anything else.

    • @tedwilson5550
      @tedwilson5550 7 лет назад

      I was hoping to find the glass, boxes,and rock tile. I was going to use them in a school assignment. They are unique, and very good looking.

  • @zilvinaskrisciukaitis5595
    @zilvinaskrisciukaitis5595 8 лет назад

    Great tutorials ! You are actually covering unusual questions! Here`s one for the future, make a tutorial for how to put two handed weapons onto characters !!! There`s not a single good tutorial for that so far !!! :/

    • @2kmixedit
      @2kmixedit  8 лет назад

      Hey thanks a lot, when I was learning to code I had a lot of questions that no one seemed to answer, so I figured most of them out by myself so I explain and answer them so other people don't have to go through the trouble. I've made a tutorial on equipping weapons, you can find it on my channel, you can use it for 2 handed weapons too, just put the models into a empty game object and use that.

    • @zilvinaskrisciukaitis5595
      @zilvinaskrisciukaitis5595 8 лет назад

      Hey mate ! I saw that tutorial, and it`s about equipping weapons into one hand, and that is clear, but when it comes to two handed, you need both hands to stay consistent with animations. Someone said to use IK system, but from what i gathered it`s quite complex. If you know an easy-ish way to anchor the hands to the weapon, please share your techniques. P.S. Not sure what you meant by that :/

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

      @@zilvinaskrisciukaitis5595 5 years and still no responses bro

  • @RaceTheAce77
    @RaceTheAce77 7 лет назад +2

    This is exactly what I needed. Thank you so much!

  • @Refref1990
    @Refref1990 8 лет назад +1

    Finally a simple and effective method to get items! Thanks so much There's only a few problems finding ... if I take an object and close there is another object, I take both objects together. Also if I put the sound object and then release, this will sound before it hits the ground. Also I would like if touching a wall, the object I keep not fall out of hand, but to continue to keep it ... is it possible?

    • @2kmixedit
      @2kmixedit  8 лет назад

      That's the thing, it's a very simple script so for some of the things you want to achieve you would have to modify it.

    • @Refref1990
      @Refref1990 8 лет назад

      Ah ok, because im not a programmer, so i don't know where to start! XD But it's ok! Thanks anyway! :)

  • @CodeTalkerLooter
    @CodeTalkerLooter 6 лет назад

    ArgumentException: Input Button Use is not setup.
    To change the input settings use: Edit -> Project Settings -> Input
    ThrowObject.Update () (at Assets/Scripts/ThrowObject.cs:37)
    How can I fix this?

  • @alexdevilish9130
    @alexdevilish9130 6 лет назад

    HOW TO MAKE THE GRAB BUTTON E

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

      where it says if has player change it to this line if (hasPlayer && Input.GetKeyDown(KeyCode.E))

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

      @@pr4thidude465 THANKS DUD

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

    mine isnt working so can you try updating us in 2019

    • @2kmixedit
      @2kmixedit  5 лет назад

      Sure, Ill fix it!

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

      Lurony thanx so much I thought you weren’t gonna reply

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

      Maybe you need to add Use input, you should do that by going into Edit>Project Settings>Input> (add one more input by making the size number bigger by one)>Name it *Use* >set positive button to *e* (you should also bind it to other buttons) You should also check of (type = Key or Mouse) and Axis = X axis

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

    That worked great

  • @benson8060
    @benson8060 7 лет назад +1

    Sometimes when i pick up or drop a object it disappears.