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!!!!
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
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.
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)
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. :(
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 :(
@@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
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?
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...
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?
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!
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...
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?
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.
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?
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.
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.
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.
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?
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
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
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.
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
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
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
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)
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.
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
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?
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)
IndexOutOfRangeException: Array index is out of range. ThrowObject.RandomAudio () (at Assets/scripts/ThrowObject.cs:69) ThrowObject.Update () (at Assets/scripts/ThrowObject.cs:53)
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.
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.
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!
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").
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)];
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 :)
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
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
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.
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!
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
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.
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 !!! :/
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.
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 :/
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?
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?
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
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!!!!
this works perfectly, even 2 years after the making of this video, youre still helping people out with this. thanks a lot!
Which player controll system you use, please drop the script.
Even 4 years after the making of this video, you're still helping out alot!
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
Thank you SO much for the public script, works perfectly, easy to understand and edit! life saver.
The entering&exiting vehicles v2 video is next for everybody who's having troubles with it.
Lurony you should make one on how to make a vehicle
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.
sir can you make script for paper toss? please using unity engine
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)
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. :(
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 :(
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?
Did you figure it out? I also have this problem :
Me too
@@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
@@jimmyahlvik2286 Thanks, that was the problem indeed.
i get the error "Input button "Use" is not setup. does anyone know how to set up an input button for the "use" function?
The object is clipping through walls and other rigid bodies. Any help?
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?
The pointer thing is a part of the UI just create an image, center it, set the anchors to be in the center.
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...
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?
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?
i can't find the code somebody help me
how to have 1st person camera like you did. Mine doesn't have that kind if pointer..
Canvas + 2d sprite image
Hello i have a save system and object dont' load in the correct position can you please see project?
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!
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?
how do you make the input settings work?? no matter what i do i cant pick it up with any key
This is how I sound when talking about game development glad to see I'm not alone 😂
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...
I could throw the object but I cant pick it up, Can you help me fix this please?
if you have two objects you pick them both up. this can cause some crazy stuff to happen.
does anyone know how to stop it picking up more than one object at once?
Did you ever solve this? Im trying to pick up a rope without all of the nearby parts becoming kinematic
@@eddiequeboard2672 no i didnt sorry
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?
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.
+Lurony Looking forward to seeing what changes you implemented in v2 entering and exiting vehicles :)
Just wondering. When you put this code in, what button do you click to lift the object?
E
Whats the cube thats parented to the camera? When I pair my object to my fps it just moves with it...
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?
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.
Very well explained !! thanks a lot
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.
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.
@@2kmixedit Oh, interesting. Thank you! : )
witch button you use to grab
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?
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
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
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?
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"
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.
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.
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
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...
ArgumentException: Input Button Use is not setup.
To change the input settings use: Edit -> Project Settings -> Input
what i need there? PLEASE HELP
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.
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
Everything is shown in the video, try rewatching.
how to make an animated model throw a rigid body? please help
The referenced script on this Behaviour (Game Object 'mediumBox') is missing!
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.
what button to hold or throw it
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
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)
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
then you need to set it up
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.
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
nothing happens when i put the script in and try to pick up a box
Bro, this objects not come to with me. I take it in my hand, but it doesn't come with me.
for some reson im not able to pickup the object :(
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
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?
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
Copy all of the components from the sphere and add them to the empty parent, delete the components of the sphere.
okay, tried it. Ball isn't deforming anymore, but i cannot lift it.
this is what i call progress = )))
Uptade: It actually worked!!,now i realise adding the script to that empty game object actually makes it work! Thank you
Very good for my project, thank you
i'm unable to pick up the object . i copied the script from the website. could someone help me
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)
You haven't set up the Use button in the input settings.
Lurony can u help me? I'm at school now, but when i go home, i want to continue my game...thx!
IndexOutOfRangeException: Array index is out of range.
ThrowObject.RandomAudio () (at Assets/scripts/ThrowObject.cs:69)
ThrowObject.Update () (at Assets/scripts/ThrowObject.cs:53)
i dont now how to fix it.i need audio effect?
please help :(
hi one question how to make the use function?? srry just switched from leadwerks to unity help me pls
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.
srry but there is no option for me to add a new input help?
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?
never mind fixed it thanks for the script
Probably an error with the colliders.
hello i have problem with your script throw and grab:( say ArgumentException: Input Button L is not setup problem how to fixx??? plz helpppppp
You haven't set up the input button for L
ty help me :)
impossible to change mouse button drop the object with e input?
Look up on using the input settings in Unity its really simple.
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.
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!
Check the scene, does the object get parented to your player once you pick it up?
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").
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.
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)];
Nevermind, I got it to work!! THANK YOU SO MUCH for making this.
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 :)
it does not work for me... is says: "cannot find script class" when i try to put the script on a object :/
You have to name the script the same in the editor as in the mono develop class inside the script.
OK thnaks :D
Will this works with slamming animation ?
How we can sort the objects?
Please help I keep getting the error : input use is not set up.
Go to your project settings find inputs and set them up.
obviously, but i dont know how
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
Works on unity 4.7?
How did you make your mouse disapear?
He used the standard assets fps controller which has a mouse lock
the script is correct but when i test it out i cant grab my object
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
The script is on github it's called throw object.
how this project working with kinect control ? thanks
Hm, depends on the mouse look script you're using.
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)
Wouldn't it be better to use a raycast and check the tag of the object..but great video tho..
'The referenced script on this behaviour (Game Object 'default') is missing!'what should I do?
maybe attach the missing script like it tells you to do? :D
Great tutorial rlly helpful!
Is there a way to make it work on mobile games?
Of course just search up the mobile inputs and edit the code.
Exactly what i want, just i want you to like, write the script and show me how to do what you are doing
Glad you enjoy it :)
wow lol you replied fast
please do tutorial on split screen!!!
3D FPS
Awesome video :) btw what key do i click to grab?
Make an Input called Use and set the positive button to E, when you press E you pick up the obhect :)
nothing happens when i click e :(
Where can I find the ''input Settings'' to set my ''E'' Button as ''Use''
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.
It doesn't seem to work for me in Unity 2019 ;-;
well im on 2020 and it works fine
@@Nuff.x how did you get it to work
dude lurony pls tell me how to get these naruto assets
which key you used for throwing object?
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!
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
Thanks gonna use this in my game
Will this work with third person controller I want to know please
Yes, might need some changes tho.
What changes and also thanks for video
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.
You aren't paying attention, the script is called ThrowObject you can clearly see that in the video, it is located on the website.
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.
Thanks for sharing your script.
Always :)
i saved the github page
dont delete it :)
WUt?
channel is underated
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.
The scripts are the assets I didn't include anything else.
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.
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 !!! :/
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.
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 :/
@@zilvinaskrisciukaitis5595 5 years and still no responses bro
This is exactly what I needed. Thank you so much!
No problem :)
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?
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.
Ah ok, because im not a programmer, so i don't know where to start! XD But it's ok! Thanks anyway! :)
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?
Nevermind. I did it :D
Can you tell us how?
HOW TO MAKE THE GRAB BUTTON E
where it says if has player change it to this line if (hasPlayer && Input.GetKeyDown(KeyCode.E))
@@pr4thidude465 THANKS DUD
mine isnt working so can you try updating us in 2019
Sure, Ill fix it!
Lurony thanx so much I thought you weren’t gonna reply
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
That worked great
Sometimes when i pick up or drop a object it disappears.