How To Make A Drop and Pick up System for Weapons/Items in 5 MINUTES | Unity 3D

  Рет қаралды 20,134

Noblob

Noblob

Күн бұрын

Пікірлер: 110
@nitram3801
@nitram3801 2 жыл бұрын
The object just moves and rotates on the ground and it is not picking up. I need help please ASAP
@Iloveroblox45
@Iloveroblox45 2 жыл бұрын
I dont know why but when i press f it pick up but when i drop it , it does not go straight , it goes left and also when i press f it starts moving until i go in pickup range. PLEASE REPLY FAST I NEED IT
@SIS_GAMER
@SIS_GAMER 5 ай бұрын
why my gun drop but dont pick, my gun rotate
@maximjacquet2942
@maximjacquet2942 2 жыл бұрын
This channel is sooo underrated. I love all the content you make and as a new programmer I really like all of your tutorials. Thank you so much!
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@princerudriyal9514
@princerudriyal9514 6 ай бұрын
I am working for my horror game i need realistic pick up feature and i saw your video but after complete the whole step it shows me this error MissingComponentException: There is no 'Camera' attached to the "First Person Controller" game object, but a script is trying to access it. You probably need to add a Camera to the game object "First Person Controller". Or your script needs to check if the component is attached before using it. Equip.Shoot () (at Assets/Scipts/Equip.cs:33) Equip.Update () (at Assets/Scipts/Equip.cs:26) Please help me for this Peace
@mikwns3722
@mikwns3722 3 ай бұрын
which key or button do you use to pick the object up
@pursuer7632
@pursuer7632 2 жыл бұрын
the script worked and i am able to unequip my gun when i press f but i cannot get it back to my hand when i press f agian it just rotates pls help
@PsychoStudiosOfficial
@PsychoStudiosOfficial 2 жыл бұрын
How do I make it start on the ground?
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@armandopaez8882
@armandopaez8882 Жыл бұрын
Your videos are a hidden gem. Thanks in advance. I wanted to ask you if you could give me a hint on how to pick up the weapon and reload the weapon with the same button: press once to reload and hold to drop and pick up the weapon that is on the ground, without an action affecting the other. I know it's not your obligation, just in case you can. Thank you.
@NoblobRS
@NoblobRS Жыл бұрын
This is actually very interesting because I don't know if I've ever done something like this before but I think I thought of something that works! I will try to test it and let you know if it works! :)
@armandopaez8882
@armandopaez8882 Жыл бұрын
@@NoblobRS It is possible that it should not be as I am asking for it. Maybe I'm wrong. I mean creating a reload and pick up system with the same button as it works in most games like Fornite, War Zone, or Apex Legends, that is, while you are looting you pick up the weapons quickly by holding the button down, but that The same button is the one that works to reload the weapon. Especially on Gamepads. Possibly 2 scripts or something like that are necessary to achieve that system. Thanks.
@rowdylegion
@rowdylegion 2 жыл бұрын
I tried this script but it says I have an error CS1003:Syntax error ‘,’ expected. I have no idea what that means, do you mind explaining it?
@NoblobRS
@NoblobRS 2 жыл бұрын
First of all, It is much more likely that it said ";" unexpected so im not sure if that is a typo or not. If not, it just means that either a comma is missing from somewhere in the script (probably the "if (Physics.Raycast(Camera.transform.position, Camera.transform.forward, out hit, range))" part. If no commas are missing, then there might be a ";" or a "," somehwere that there is not supposed to be. Again, probably at the end of if "(Physics.Raycast(Camera.transform.position, Camera.transform.forward, out hit, range))", there is an extra ";". If none of these help, could you please send the whole error so i can see what line it is on? Thanks! Also, if you just want to be done with the error, the completed script is in the description! :)
@rowdylegion
@rowdylegion 2 жыл бұрын
@@NoblobRS thanks for responding, I found out the problem and fixed it. I just forgot to include an =. I finished the script but the weapon just falls through the floor when unequipped. You already answered a question like that in a different comment so I'll use that. You're the first video I watched that actually worked in weapon pick up so thank you
@rowdylegion
@rowdylegion 2 жыл бұрын
@@NoblobRS I seem to be having another problem with the weapon not letting me requip it. It's not falling through the floor anymore but it when I try picking it up it jolts up but falls down back to the ground. Do you know a way to fix it by any chance?
@NoblobRS
@NoblobRS 2 жыл бұрын
I can't really think of anything at all that would cause that right now. Unless your weapon has an animation or something else different attatched to it maybe? I'm not too sure but if I think of something, I will let you know! Good luck!
@rowdylegion
@rowdylegion 2 жыл бұрын
@@NoblobRS thanks
@xDDean
@xDDean 3 ай бұрын
@noblob why does it fall through the map
@UnknownJst54
@UnknownJst54 2 ай бұрын
THATS WHAT IM SAYING
@gnrinried
@gnrinried 2 жыл бұрын
when i drop my weapon it falls trough the map, why?
@NoblobRS
@NoblobRS 2 жыл бұрын
Make sure your weapon has a Rigidbody and a collider. I think this could also happen if your terrain is too thin.
@gnrinried
@gnrinried 2 жыл бұрын
@@NoblobRS got them and my floor isnt really thin
@NoblobRS
@NoblobRS 2 жыл бұрын
Could you floor not have a collider attached to it?
@gnrinried
@gnrinried 2 жыл бұрын
@@NoblobRS it does have one, and also i realised if i press f again the gun freezes mid air and when i press f to drop continues falling
@NoblobRS
@NoblobRS 2 жыл бұрын
Thats very odd. Nothing like that has happened for me. Its possible that there's something else in your game that is interfering with it although I do doubt that.
@MANGASAGAS
@MANGASAGAS 3 ай бұрын
who can i pick up the gun
@artdays9561
@artdays9561 2 жыл бұрын
When I drop my gun, it falls through the map, Pls help!
@PlaneMusic46294
@PlaneMusic46294 Жыл бұрын
add ridgidbody and a boxcollider to your gun
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@Buzala26
@Buzala26 2 жыл бұрын
when i have item in my hands character automatically starts walking and doesn't stop. you have any clue why is that?
@NoblobRS
@NoblobRS 2 жыл бұрын
My guess would be that whatever key you set to pick up the item is somehow interfering with your walking script. Other than that though, I have no clue how this is happening. Good luck! :)
@Buzala26
@Buzala26 2 жыл бұрын
@@NoblobRS Soo I managed to fix backwards walking problem but.... now when I drop it and press pick up button it starts rotating :P btw sorry if am being kinda annoying.
@NoblobRS
@NoblobRS 2 жыл бұрын
Dw about it! Is it continously rotating or does it do like a sudden jerk? (It might have something to do with this line: Gun.transform.eulerAngles = new Vector3(Gun.transform.eulerAngles.x, Gun.transform.eulerAngles.y, Gun.transform.eulerAngles.z - 45); )
@Buzala26
@Buzala26 2 жыл бұрын
@@NoblobRS It's like when I press it, it rotates like 30 degrees and when I press pick up button again it does that again. and it goes like that again and again.
@NoblobRS
@NoblobRS 2 жыл бұрын
Oh ok! So that was actually intentional because it was supposed to rotate on its side when you drop it! Try deleting this line: Gun.transform.eulerAngles = new Vector3(Gun.transform.eulerAngles.x, Gun.transform.eulerAngles.y, Gun.transform.eulerAngles.z - 45); That should fix it! Let me know if it doesn't! :) (it should be on line 47)
@mr_losduos4607
@mr_losduos4607 2 жыл бұрын
I cant pick the weapon up again why is that i can drop it there is no error???
@NoblobRS
@NoblobRS 2 жыл бұрын
What exactly happens when you try to pick it up? does it disappear or does it just stay on the ground?
@mr_losduos4607
@mr_losduos4607 2 жыл бұрын
@@NoblobRS i figured it out i works now i just happens to set the pick up in the wrong palace of the code so it dindt play the only Thing i ha e to work on is when i drop My weapon i can pick it from evry where i am
@NoblobRS
@NoblobRS 2 жыл бұрын
Try adjusting the distance (It should be set to 2 by default)
@bigboyhank6202
@bigboyhank6202 2 жыл бұрын
Hi Noblob, great tutorial. I have one problem. If you can help me fix it, I’ll like and sub. When I try to pick the weapon up it just jerks to the side. I have tried increasing the range. And everything please respond as fast as possible. Thanks
@ZefiDev
@ZefiDev 2 жыл бұрын
Nice tutorial I can drop the gun but when i pick it it stays on the ground and it just changes direction
@Shonen.Snap07
@Shonen.Snap07 Жыл бұрын
same here
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@DeadDayDev
@DeadDayDev 5 ай бұрын
same pls help
@amirsharifnia3368
@amirsharifnia3368 2 жыл бұрын
when i try to pick it up the gun ust bobs up and down i have tried increasing the range and everything
@xermi00
@xermi00 Жыл бұрын
Hey, I'm having a problem with this. When I press F and I drop the item it collides with the Player and follows me and my Mouse Look. Do you know how to fix that?
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@sternsascha1993
@sternsascha1993 7 ай бұрын
Könnten Sie ein Inventar System und zeigen wie man sowas macht so das man 3d Items verwenden kann. Ich finde nix orgendliches 😐 was wir helfen könnte.
@TeachMeSam
@TeachMeSam Жыл бұрын
It's very basic, doesn't help me much, but you got a sub cause you have more interesting vids to watch. Keep up the good work!
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@mitlopz519
@mitlopz519 2 жыл бұрын
i can drop my gun yes but im still shooting without gun how can i fix it ?
@lungomungo
@lungomungo 2 жыл бұрын
HALP when i drop my object, the transform player goes out of the other components, like camera and player transform, causing my player not to move and look only on the y axis
@fishussugon3215
@fishussugon3215 Жыл бұрын
not sure if you're describing a mistake that i have experienced but was able to solve by myself but makes sure "Player Transform" transform is attached to the script, not the entire Player prefab parenting the Camera
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@AntoineMathieu-pm4zo
@AntoineMathieu-pm4zo 8 ай бұрын
I drop and my camera and my player freeze
@zouxa
@zouxa 2 жыл бұрын
when i try to pick up the gun it just moves around on the floor
@NoblobRS
@NoblobRS 2 жыл бұрын
Try increasing the range?? Let me know if this doesn't work so I can look into it! thanks! :) Also, make sure the weapon has the target script applied to it.
@zouxa
@zouxa 2 жыл бұрын
@@NoblobRS yes the weapon has a script in it
@yassirbholah3653
@yassirbholah3653 2 жыл бұрын
@@NoblobRS same problem,increasing the range makes it move further away
@bigglasses2625
@bigglasses2625 6 ай бұрын
The revolver moves away from me when I move
@bigglasses2625
@bigglasses2625 6 ай бұрын
I figured it out, turning on interpolate and continous detection causes this
@KilleraserPros
@KilleraserPros 3 күн бұрын
tysm
@fatahmadrid7806
@fatahmadrid7806 2 жыл бұрын
Thank you Keep up bro And thanks to give us scripts that what i like about you this is sow nice from you you are the best
@NoblobRS
@NoblobRS 2 жыл бұрын
Thank you!
@zouxa
@zouxa 2 жыл бұрын
or it starts to rotate when i try to pick up
@NoblobRS
@NoblobRS 2 жыл бұрын
I think someone else had a similar issue so you can try some of the things i told them to try to see if it works!
@zouxa
@zouxa 2 жыл бұрын
@@NoblobRS i tried but you sill cant pick it up anit doesnt rotate anymore
@zouxa
@zouxa 2 жыл бұрын
also Im using unity standard assets fps controller so should this still work with it
@learntech3323
@learntech3323 2 жыл бұрын
thanks for the tutorial but when i copied the script it made an error and the error is the namespace already contains a definition for 'Target' please reply as fast as possible
@NoblobRS
@NoblobRS 2 жыл бұрын
Did you accidentally add 2 Target scripts?
@learntech3323
@learntech3323 2 жыл бұрын
Yeah i think i accedintaly did Thank you very much You really will get a lot of subscribers in the future Keep it up dude 👌
@mrbobo4614
@mrbobo4614 2 жыл бұрын
is it possible to have more weapons? so there is not just one pick up
@NoblobRS
@NoblobRS 2 жыл бұрын
Yes, It will work with multiple weapons, youll just need to replicate both scripts for each weapon! :)
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@bigglasses2625
@bigglasses2625 6 ай бұрын
@@NoblobRS When I tried this, it picking up the original weapon
@yassirmuhammad.b973
@yassirmuhammad.b973 2 жыл бұрын
Hello, I'm using a weaponholder for weapon switching (a video from brackeys ) but i want one of my guns to be able to pick up how can i implement this code in the weapon holder
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@ninjaLoveTheWorld
@ninjaLoveTheWorld 2 жыл бұрын
Thanks for your video it’s easy to follow and it helps me clear my codes! I’m having a issue that when I drop the weapon it falls under the ground (mesh collider for ground) and I have rigid body and box collider for my weapon, I also have the target script for weapon. Do u know what’s going on?
@ninjaLoveTheWorld
@ninjaLoveTheWorld 2 жыл бұрын
I’m using unity 2020.3.25 though not sure if that is the issue. Do you recommend a newer version or is 2020 the better one?
@NoblobRS
@NoblobRS 2 жыл бұрын
I think some other people had the same issue! If your ground isn't a terrain and can be easily adjusted, try making it thicker! If you can't do that, you can try some of the things I suggested to the other people! :)
@NoblobRS
@NoblobRS 2 жыл бұрын
I'm using the 2020 also version because the newest version is usually more buggy but it shouldn't really matter that much! :)
@VdubVR
@VdubVR Жыл бұрын
All you have to do is add a box collider
@danyebest4805
@danyebest4805 Жыл бұрын
@@NoblobRSok
@Clasher_7617
@Clasher_7617 2 жыл бұрын
When I try to pick up the gun just moves
@NoblobRS
@NoblobRS 2 жыл бұрын
Have you applied the Target script to the gun? :)
@Clasher_7617
@Clasher_7617 2 жыл бұрын
@@NoblobRS yes
@Steamgoguema
@Steamgoguema Жыл бұрын
i cant pick up help me
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@thinkfreely1270
@thinkfreely1270 2 жыл бұрын
Thanks
@benbeyy6914
@benbeyy6914 2 жыл бұрын
for me when i equip it it goes to the bottom of the screen any idea on how to fix it?
@NoblobRS
@NoblobRS 2 жыл бұрын
Just move the Player Transform to wherever you want the gun to go when you equip it! So like move the player transform higher up. (The gun goes to the player transform when you equip it) If this doesn't work, let me know so I can try and help further! Thanks! :)
@ciaranfxfilms
@ciaranfxfilms Жыл бұрын
Thank you so much!
@danyebest4805
@danyebest4805 Жыл бұрын
Ok
@ChanzOntop
@ChanzOntop Жыл бұрын
the weapon moves witht he character
@thg1nrediar
@thg1nrediar 2 жыл бұрын
Good
@dexisha
@dexisha Жыл бұрын
@noblob it works fine to drop it but not pickup for me!
@arkothegamedev
@arkothegamedev Жыл бұрын
I Have an Issue. When I Drop The Item it Falls Through Terrain.I Added Rigidbody But it Still Falls Through Terrain.What Should I do?
@PlaneMusic46294
@PlaneMusic46294 Жыл бұрын
you need both a rigidbody and a box collider
How to Pick Up + Hold Objects in Unity (FPS)
3:42
JonDevTutorials
Рет қаралды 33 М.
[BEFORE vs AFTER] Incredibox Sprunki - Freaky Song
00:15
Horror Skunx 2
Рет қаралды 20 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 35 МЛН
Подсадим людей на ставки | ЖБ | 3 серия | Сериал 2024
20:00
ПАЦАНСКИЕ ИСТОРИИ
Рет қаралды 584 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 59 МЛН
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
FULL PICK UP & DROP SYSTEM for WEAPONS or ITEMS || Unity3d Tutorial
5:45
Dave / GameDevelopment
Рет қаралды 192 М.
I Made A Difficult Game About Climbing
15:04
Pontypants
Рет қаралды 2,2 МЛН
A Fan Asked Why His Game is Failing...
30:53
RoBuilder
Рет қаралды 155 М.
THIRD PERSON MOVEMENT in Unity
21:05
Brackeys
Рет қаралды 1,5 МЛН
Unity's NEW input system in 13 minutes
13:02
BiteMe Games
Рет қаралды 30 М.
SAVE & LOAD SYSTEM in Unity
18:20
Brackeys
Рет қаралды 1,1 МЛН
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 677 М.
[BEFORE vs AFTER] Incredibox Sprunki - Freaky Song
00:15
Horror Skunx 2
Рет қаралды 20 МЛН