FULL PICK UP & DROP SYSTEM for WEAPONS or ITEMS || Unity3d Tutorial

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

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

  • @davegamedevelopment
    @davegamedevelopment  Год назад +6

    If you need help with any of the code shown, just visit the "coding-help" channel on my discord server :D
    Also you can find many more tutorials on my channel in the "Tutorials!" playlist - I really hope they help you on your further GameDev journey!
    And in case you're interested in getting access to my full RANGED COMBAT LAB, with which you can create pretty much any ranged ability/weapon you can think of, check out the trailer:
    🏹 RcLab Trailer: ruclips.net/video/j2YplilHjCA/видео.html
    Thanks so much for watching, hope this tutorial has helped you!

  • @taylormarinescu805
    @taylormarinescu805 4 года назад +125

    This guy is such a good youtuber. He creates full, easy to understand tutorials and responds to almost every comments even if it's off topic. 100% liked and subbed :)

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +12

      Thank you so much! :D

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

      @@davegamedevelopment i dont know why the Pickup stuff didnt work
      the gun is droped but The pick up does not work
      but thx u helped us so much 😁😁

  • @creapermann6356
    @creapermann6356 4 года назад +117

    I almost cried as it worked, i spent over 10h on it

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +49

      I feel you man... Sometimes coding stuff takes wayy too long :D

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

      Dave / GameDevelopment I have a question. Will it work if I just use Right click in the part where it says E or or what does the code need to say if I want right click pick up ?

    • @TUMENG-TSUNGF
      @TUMENG-TSUNGF 4 года назад +1

      Input.GetMouseButtonDown(1)

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

      @Domantuso_gaming mate can you just say fuck and shit without censoring it

    • @bruh-gy6yx
      @bruh-gy6yx 4 года назад +1

      @@developer2 lmao

  • @ilypavan
    @ilypavan Год назад +11

    Set Interpolate to :None
    if your object is not moving as your view camera.

  • @crazykidplayz6498
    @crazykidplayz6498 3 года назад +16

    This man deserves more support his tutorials are amazing! I’m writing this comment to show all the support I can!

  • @gizmowizard352
    @gizmowizard352 23 дня назад

    I made a really buggy controller for pickups, and oh was it awful, then I discovered your channel, and whoosh! Nice controller. The best part is, I get it. I understand, what is happening, I can tweak it and add effects, functions, etc. That is what makes this special from the other tutorials on YT. Great job.

  • @disgraceme
    @disgraceme 3 года назад +67

    Here's the script:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class PickupGun : MonoBehaviour
    {
    public Gun gunScript;
    public Rigidbody rb;
    public BoxCollider coll;
    public Transform player, gunContainer, fpsCam;
    public float pickUpRange;
    public float dropForwardForce, dropUpwardForce;
    public bool equipped;
    public static bool slotFull;
    private void Start()
    {
    if (!equipped)
    {
    gunScript.enabled = false;
    rb.isKinematic = false;
    coll.isTrigger = false;
    }
    if (equipped)
    {
    gunScript.enabled = true;
    rb.isKinematic = true;
    coll.isTrigger = true;
    slotFull = true;
    }
    }
    private void Update()
    {
    Vector3 distaceToPlayer = player.position - transform.position;
    if (!equipped && distaceToPlayer.magnitude

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

    top 10% of Unity tutorials right here, and I've sure as hell watched pretty much all of them

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

    This Guy Is A Such A Good Person, He Gives The Codes And Understands We Easily

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

    im so glad i can find a tutorial youtuber like you bc most of the other youtubers are just like do this do that then you will have this. but u explain what everything means wich is very helpful for beginners like me.

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

    Thanks, i tried the last month to do a good pick up and drop script cause there is no one on youtube. You just got one new active member :) TY

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

    Gotta say man seriously good content unlike any other youtuber! keep it up!

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

    You my good sir is a legend among this community, insane tutorial💪🏻

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

    Mannn this is such an amazing tutorial! everything worked perfectly at one go! I wish you all the best with your channel!

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

      are you using his movement system and if so where does the guncontainer go to?

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

      @@itzdimi7569 I'm not using his movement system...but my gun container is the child of my camera

  • @Justeeee115
    @Justeeee115 7 месяцев назад +1

    Hi I've been working on top down 2d game and cant really find a good tutorial for pickup and drop weapons so I have no choice but to use this tutorial and after editing the whole script to work with 2d I've manage to make it work so awesome thanks for this tutorial helpful enough!

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

    my game just became 1 step closer 2 done. Thank you so much for this tutorial!

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

    Coming back to these tutorials after learning c# and they are so much easier to understand!

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

    super well done man! Even though it's almost a 2 year old video it helped me a lot.

  • @useless.production
    @useless.production 2 года назад +1

    You are the best! I hope you keep making these tutorials!!!!

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

    Dave you truly are amazing so far you are the only unity tutorial creator that shares his code for free and also the only one who has code that works first try love your tutorials they help me real good and it's easy to understand thank you so much keep it up

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

    Thankyou so much Dave, works very well making my game so much better!

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

      Glad I could help!

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

      @@davegamedevelopment Sorry to ask, but would you know how to make dani's grid material, not the prototype grids one but the new one that he usesin his videos

  • @lucasburford7881
    @lucasburford7881 3 года назад +5

    Absolutely amazing, thank you so much, my player can now pick up a flashlight in my horror game! 😁

  • @thisisit.thisishowitends5181
    @thisisit.thisishowitends5181 2 года назад

    Great tutorial, Dave has the best unity tutorials

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

    Very nice
    Used it in my.personal project.
    Working well
    Enjoying playing with the script.

  • @Asensado
    @Asensado 4 года назад +15

    Hey Dave, so I realized that when you pick up the gun, it just teleports to you. But when you throw it, it smoothly reacts to gravity and makes it feel that you're actually throwing the gun. I want to also feel that I am picking up the gun, not teleporting it to my hand. Anyways, nice video. Keep it Up!

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

      For this you need to learn a bit about the Vector3.Lerp and Quaternion.Slerp functions, then it should move smoothly from one point to the other :D
      But for some reason it didn't really work when I tried out

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

      @@davegamedevelopment slerp

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

      Hi! I know it is bit late but anyway. I think you already solved it but for any chance if anyone is looking for this it is a bit simple but tricky.
      For this instead of setting local position in pick up you will do it in FixedUpdate(). (Note: I would love to share the script however I made many changes to the original version for my preferences)
      1) Just add two new parameters :
      float pickUpTime;
      bool pickingUp;
      2) Then you will chance script a bit. You will remove the part where you set your gun position. Instead you will add two lines :
      pickingUp = true;
      Invoke(nameof(PickUpFinished), pickUpTime);
      3) Make a new method :
      void PickUpFinished()
      {
      pickingUp = false;
      }
      4) Last step paste in these lines into FixedUpdate() and that is all :
      if (pickingUp && currentWeapon != null)
      {
      Vector3 zero = Vector3.zero;
      currentWeapon.transform.localRotation = Quaternion.Slerp(currentWeapon.transform.localRotation, Quaternion.Euler(Vector3.zero), Time.deltaTime * pickUpTime * 10f);
      currentWeapon.transform.localPosition = Vector3.SmoothDamp(currentWeapon.transform.localPosition, Vector3.zero, ref zero, 1f / (pickUpTime * 10f));
      }
      Note : These variables there are not that perfect. I haven't completed it yet put it does the job for now.
      I hope that is what you need. Good luck with your game!

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

      ​@@zeaglee3432 Thank you it helped me a lot, it's all working fine but when I change the pickUpTime on the inspector nothing changes so I'm wondering why? is it supposed to be act like that or not?

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

      @@zeaglee3432 says currentWeapon doesnt exist

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

    Thank you, I hope you helped many people, for some reason, this broke my entire game having to completely restart. Nothing against you, probably something i did wrong, but i hope you can help other people

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

      Oh sorry, I don't think it was your fault, sounds more like Unity's problem, normally a simple script shouldn't break your whole game... :(
      But glad your not angry, if you want you can still download the project file and check out how everything is set up there :D

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

      @@davegamedevelopment All good, just got a different tutorial for pick up and drop thanks for replying

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

    Thanks you so much i keep finding this tutorial

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

      No problem :D Congrats for first comment btw :D

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

      @@davegamedevelopment you are an amazing guy (;

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

      @@imzary Thanks :D

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

      @@davegamedevelopment np :D

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

    This tutorial helped me a lot, thank u so much now i've eradicated what i was having trouble with. i love u mate, i mean i love u as a friend really... oh no... it is coming back

  • @unknownunknown-pg1fg
    @unknownunknown-pg1fg 4 месяца назад

    Thanks for the help. Took 15 minutes and works great

  • @TheRealWhatKid
    @TheRealWhatKid Год назад +4

    Hi, I know this video was posted 2 years ago, but hope you can help. I followed the tutorial and got done, but, when I click E it will go to what I set it to go (Item Container) to but then it just floats around and doesn't exactly stay with the Item Container when I look around. How do I fix this?

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

    Great tutorial, just one thing. After adding this, the shooting just broke. The bullets now fly backward and not out of my barrel. Any idea why this is happening?

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

    First tutorial with pick up and drop combined. Thxx for that. Without this i would die

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

    My god, thank you soooooo much for adding the script download!!!!! :)))

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

    Amazing content and explanations!

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

    there u go mate ur new sub and a follower...i like ur content keep posting more..all the best

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

    what happens with me is my gun dont stay in my hand it starts going forward when i go backward and when i go backward it gos forward and ive tried turning off all rotations on the rigid body but it didnt work all I know is that everytime i enable the rigid body it stays in one place plsss help

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

      the only thing that works is the throw machinic which gets thrown from a far distance

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

    I set the rigidbdy to extrapolate and continous dynamic but it still bugs?

  • @sp0ngebob561
    @sp0ngebob561 4 года назад +5

    Hi great video btw but I have a problem
    You typed projectile gun which means I could also type the name of my weapon if I'm correct but it couldn't be found and asked if I'm missing a directive or assembly reference
    I need help please reply 🥺

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

      You need to take the exact name of your gun script (The one that makes your gun shoot :D)

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

      @@davegamedevelopment yup I found out yesterday lol thanks for the reply

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

      @@davegamedevelopment im confused, i try to rename it but it says that there is already a script with the same name

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

      @@ezrawrx You probably used a name that's already used by Unity (like System, Input etc.) :D
      Try changing it :D

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

      Dave / GameDevelopment thank you so much!

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

    It's perfect!
    Currently working on a simple FPS like Hotline Miami, but with Max Payne's slow motion (or SUPERHOT with generic slow-mo?). Ability to grab and throw guns was just what I needed.

  • @cpt.ghostriley735
    @cpt.ghostriley735 Год назад

    This video is much better than the others cuz now he's showing hierarchy

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

    thanks, after 3 days i finally found this video

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

    i dont get the projectilegun part what exactly is that

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

    BEST PICKUP SYSTEM EVER THANK YOU SO MUCH

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

    You are just awesome dude !!! Thanks !!!

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

    Thank you so much! This worked for me! You've earned my sub!

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

    Hi, great video!
    I have a problem that when i put the script on more than one gun then i press E on any one gun the other gun comes to me please help.

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

      You need to set the "Equipped" bool correctly before you start the game :D

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

      Dave / GameDevelopment K, thanks a lot

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

    you explained it that good i even did it in 2D game.

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

    Thanks man ur great help for who just start learning XD

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

    For those whose guns are falling through the floor when you drop it, try changing the size of the box collider and make it so it wont clip the floor when you throw it

  • @gaminganimator-qp2ir
    @gaminganimator-qp2ir 4 года назад

    Been waiting for this one

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

    errors gunprojectile missing

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

      Same thing I’m getting

  • @goatedzr354
    @goatedzr354 Год назад +2

    for anyone whose gun is still shooting even tho its unequipped, put the code that you put in hte start function in the update function. so it doesnt just exacute that from the start.

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

    Hey! Amazing tutorial! One problem is that the item i am holding seems to move ahead of my player or move behind my player when i move. But moving my camera around seems to work fine. Any idea on what might be happening?

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

      Im also facing the same issue pls some one help

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

      Lucky For you I just found the solution, in the rigid body just use interpolate as none it fixes it

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

      @@sdp_studios Thanks

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

      @@sdp_studios Love you. My hero.

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

      @@sdp_studios OMG MY HERO BRO I was wondering why this was happening to me I spent hours trying to fix it and then I see ur comment thank you bro

  • @Kosten47
    @Kosten47 Год назад +5

    To everyone who has the problem with this line:" public ProjectileGun gunScript;" u have to use instead of ProjectileGun the name of the gun script u have to shoot and stuff. So Get the name from the gun script and put it instead of "ProjectielGun". for example it should look like this :public Gun gunScript;

  • @ThePlaguedDoctorYT
    @ThePlaguedDoctorYT 3 месяца назад +1

    whenever i pick it up after throwing it down it for some reason grows gigantic

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

    i a shame you have only 1k subs. more people should know about you (also i like your vids they help me a lot so thanks 🙂)

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

    Love Your Channel! Perfect!

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

    im a bit late, but when i made the gun a child of the container, the gun would rotate and aim upwards, i checked the transform and it was the exact same. Also, when i drop my gun, the gun would teleport upwards to a specific place and just float there, i checked through my script and it was the exact same as yours.

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

      I had the same problem, have you solved this yet please?

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

      I've the same problem and I still can't fix it. I think he will never respond again :(

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

      @@danielmay1846I think I’ve solved it, if your gun has an animation, when the idle animation is played, it will teleport to the root position (usually 0 0). So, you have to edit the gun drop script so it turns off the animation when it drops, and reenables when picked up. Remember to put the disable animation at the top so it disables animations first before dropping.

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

      @@playerplus5917 I think I’ve solved it, if your gun has an animation, when the idle animation is played, it will teleport to the root position (usually 0 0). So, you have to edit the gun drop script so it turns off the animation when it drops, and reenables when picked up. Remember to put the disable animation at the top so it disables animations first before dropping.

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

      @@_lonely_3124 I've a grappling gun, but I don't really know *how* to turn off the animations. I tried a lot, but it still teleports to the root position

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

    omg thanks so much for this, you helped me alot!

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

    What if I have multiple gun scripts?

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

    do i put the code in the player or the item?

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

    How do I make it so I can have a secondary primary and a third option? I’m not using this script for guns it’s for items

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

    Can you do this with other objects other than guns if we change the gunscript

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

    Cool tutorial keep it up 😃😃👍👍

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

    Dani aproves about the player object

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

    good shit, brackeys level!

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

    I loved this, its exaclty what i needed!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

      Glad you liked it, thanks for watching! :D

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

      Dave / GameDevelopment thanks for hearting my comment

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

    if I drop mine it goes under the map itself any ideas?

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

    Well that's odd. I followed your tutorial and encountered a weird bug. When using extrapolate, my item would stay in place wherever i go but would still rotate. however when i switched it to none. it fixed it.
    Not sure if this has something to do with the new unity version but yeah. If anyone else encounters the same bug, that's how i fixed it. Not sure if it's a permanent fix, but it gets the job done.

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

      I've been trying to fix it for so long now but to no avail. Setting the interpolation it to none do actually fix it but the physics of the gun wouldn't be smooth when reacting to gravity or other rigidbodies. If anyone has a fix to it please tell me

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

      @@mhausage3454 hey bro did you ever find anything out? i just had to change interpolation to none and im hoping you found a fix for the rough physics?

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

    For anyone who is experiencing their weapons floating up on pickup try making a separate game object called "gun stash" or something and put all of your weapons inside there. it fixed the issue for me.

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

    One sentence for this video: YOUR AN ABSOLUTE LEGEND btw can you also make a vid of how to pick up grenade and throw it thank you

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

      Haha, thanks so much man! :D
      Also if you watch my 2 part series on Shooting with Bullets you should be able to make this grenade yourself :D (Just use an invisible gun to throw it :D)

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

      @@gaminganimator-qp2ir some people don’t know how to script yet

  • @7PM-8
    @7PM-8 3 года назад

    Really good tutorial!

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

    Gun script is a separate class with properties and methods?

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

    When i start the game the guns at the ground just slied away and if i pick them up i cant shoot. Can someone pls help me?

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

    great video! thank you!

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

    hey dave question, can this work on melee weapons like swords or knifes and how can i make it so when i throw my melee weapon it also deals damage when it collide?*

  • @elephantlegacy
    @elephantlegacy Месяц назад

    That was so awesome!

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

    AMAZING!!! I THOUGHT IT WOULDNT WORK BECAUSE I HAVE A WHOLE DIFFERENT MOVEMENT AND CAMERA SYSTEM BUT IT DID, YOURE DOPE

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

      hey rob question when setting the weapon container script (gun container but its weapons since using a sword) do i still need to position the container to the side of the fps camera or is that already done through code? like
      transform.SetParent(WeaponHolder);
      transform.localPosition = Vector3.zero;
      transform.localRotation = Quaternion.Euler(Vector3.zero);
      transform.localScale = Vector3.one;

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

      @@dcry1003 place the weapon position where you want it to be while equipped, move the container to where you want it, make sure it isnt equipped. then reset the transform on the weapon itself and it should work

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

      @@linkdev3916 thanks rob got it working now!👍

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

      @@dcry1003 im glad i could help!

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

    I'm having an issue with the shooting. I want to start the game without holding the gun which works fine. The gun isn't equipped and I can't shoot it. I pick it up and I'm able to shoot it and it's marked as equipped. However, after dropping it again, I'm still able to shoot it. Is there a way I can fix this? Thanks

  • @watershub2481
    @watershub2481 5 месяцев назад

    Thankyou so much for helping

  • @Kasuga-
    @Kasuga- 3 года назад

    GunSystem Script is not working.
    It is showing camshake is missing
    HELP!

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

    idk what to replace ProjectileGun with??????????

    • @yan-sim
      @yan-sim 6 месяцев назад

      Knife

  • @a.technology1446
    @a.technology1446 4 года назад

    Amazing content, thank u❤️

  • @Levi---q7p
    @Levi---q7p 2 года назад +2

    I'm kind of confused on how I'm able to keep the item that is picked up in my view. When I look up or down, the item stays in the static spot without following my camera's movement. Is there any way in particular to solve this issue?

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

      Make sure that your weapon holder is a child of the camera :D

    • @eliaskabrt1763
      @eliaskabrt1763 10 месяцев назад

      @@davegamedevelopmentI have same issue. Like, it moves, but really slow and it looks bad. I have it set as an child of my main camera. So idk what to do.

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

    you are legend my friend!

  • @joey._rsd7261
    @joey._rsd7261 4 года назад +1

    Everything is working good but whenever i drop the gun it goes back to 0 0 0 because i have my gun container in my fps cam, anyway i can fix this?

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

    Can you tell us how to make the bullets actually do damage

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

      Maybe watch my Enemy Ai tutorial, there I explained how to do it (or at least showed the code and said where you need to call it) :D

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

    where i should put the second gun?? does the second gun would be in the gun container or??

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

    Thank you so much this works very well you earned yourself a new sub.
    But i wanted to say that if i have a weapon without a gun script (for example a knife) it will say “Object reference not set to an instance of an object” & if i copy the script and take off the gun script reference it will think its another script so it will let me pick up both weapons at the same time.

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

    Thank you for this great tutorial
    but I have a question how you should set the localScale to 0 it should be set to new Vector3(1,1,1);

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

    ty (,: for making this tutorial can i ask what music you use ?

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

      Links in the description :D

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

      @@davegamedevelopment hey uh you might not see this but in your description you should probably link the original creator of the music, that 'audio library' channel just reposts stuff

  • @mikeydward
    @mikeydward 3 года назад +3

    Love this tutorial really excellent and well explained. How would I apply it to Photon for a multiplayer game? I have been trying to get it to work but it seems to delete the object after I drop it meaning I cannot pick it up again.

  • @TM-el5bt
    @TM-el5bt 4 года назад +1

    Great Tutorial I learned so much and everything is working for me except one thing. I can't see other weapons I picked up and maybe you know why it's like this. But keep on that good work.
    Edit: I actually fixed it so GREAT tutorial

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

    This guy might be the brackeys succesor :)

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

    go to throw the the 'gun' in my case just a cube, and it works, try again a second time and it plumets straight down, no momentum. Any help appreciated

  • @TM-el5bt
    @TM-el5bt 4 года назад +4

    Hey that was a great tutorial and everything works just fine but I'm trying to make an online game with Mirror and I've asked myself if you know what to do so the transforms do not disappear when I start and spawn a player? Pls awnser me if you know something thanks

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

      Sorry I'm currently learning Photon2 myself (also for a multiplayer game), so I don't have much knowledge about networking :D

    • @TM-el5bt
      @TM-el5bt 4 года назад

      @@davegamedevelopment Ok thanks anyway I guess I'll just try to learn more about it. It isn't that necessary so I could just implemnt some AI that should work fine and good luck and much fun at learning

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

      @@davegamedevelopment would love to see how you managed this!

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

    Thankyou man🙌

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

    Sorry for possibly the silliest of questions but...What if I am trying to do a very basic press E to pick up cube. The cube does not have a script so how do I reference it in script?

  • @factorp2030
    @factorp2030 3 года назад +3

    Why he sounds a bit like Brackeys

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

    Where are you now?? You u are not uploading anything? You just disappeared.