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

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 พ.ย. 2024

ความคิดเห็น • 757

  • @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: th-cam.com/video/j2YplilHjCA/w-d-xo.html
    Thanks so much for watching, hope this tutorial has helped you!

  • @creapermann6356
    @creapermann6356 4 ปีที่แล้ว +115

    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 3 ปีที่แล้ว +1

      @@developer2 lmao

  • @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 😁😁

  • @ilypavan
    @ilypavan ปีที่แล้ว +7

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

    • @2kmagic774
      @2kmagic774 ปีที่แล้ว

      Thanks a lot

    • @Bloodtac
      @Bloodtac 2 หลายเดือนก่อน

      thank u so much i was about to restart

    • @saimonislamsiyam9931
      @saimonislamsiyam9931 2 หลายเดือนก่อน

      Thankyou sooooooo muchhhhhhhhhhhhhhhhhhhh 😭😭😭😭

  • @disgraceme
    @disgraceme 3 ปีที่แล้ว +65

    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

  • @itztecherz
    @itztecherz 2 ปีที่แล้ว +2

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

  • @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!

  • @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.

  • @Broskibrow
    @Broskibrow 2 ปีที่แล้ว +3

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

  • @Justeeee115
    @Justeeee115 5 หลายเดือนก่อน +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!

  • @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

    • @davegamedevelopment
      @davegamedevelopment  4 ปีที่แล้ว +2

      Glad it helped you! Thanks for watching :D

    • @creapermann6356
      @creapermann6356 4 ปีที่แล้ว +1

      @@davegamedevelopment thanks for doing it

  • @tabithagiblet1644
    @tabithagiblet1644 4 ปีที่แล้ว +1

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

  • @decidev
    @decidev 3 ปีที่แล้ว +2

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

  • @keilithdevine
    @keilithdevine 3 ปีที่แล้ว +2

    this guy is as good as Brackeys (R.I.P Brackeys YT Channel)

  • @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;

    • @Eternal_Night17
      @Eternal_Night17 11 หลายเดือนก่อน

      Thanks bro that really helps me out

  • @theokruger4900
    @theokruger4900 3 ปีที่แล้ว +4

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

  • @Seestral
    @Seestral 2 ปีที่แล้ว +3

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

  • @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

  • @lucasburford7881
    @lucasburford7881 2 ปีที่แล้ว +5

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

  • @CROXoDyLE
    @CROXoDyLE 3 ปีที่แล้ว +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.

  • @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

  • @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

  • @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.

    • @JrMinalga
      @JrMinalga 10 หลายเดือนก่อน

      thank you so much

    • @goatedzr354
      @goatedzr354 7 หลายเดือนก่อน

      @@JrMinalga np

  • @gioviale7702
    @gioviale7702 ปีที่แล้ว +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

  • @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 ปีที่แล้ว

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

    • @vishnuramesh2514
      @vishnuramesh2514 ปีที่แล้ว

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

  • @cpt.ghostriley735
    @cpt.ghostriley735 11 หลายเดือนก่อน

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

  • @unknownunknown-pg1fg
    @unknownunknown-pg1fg 2 หลายเดือนก่อน

    Thanks for the help. Took 15 minutes and works great

  • @BadBanana
    @BadBanana 4 ปีที่แล้ว +4

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

  • @duelsoldier3048
    @duelsoldier3048 4 ปีที่แล้ว +1

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

  • @tylerpurner7816
    @tylerpurner7816 4 ปีที่แล้ว +1

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

  • @useless.production
    @useless.production ปีที่แล้ว +1

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

  • @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.

  • @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

  • @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

  • @AbusingEgo
    @AbusingEgo 2 ปีที่แล้ว +2

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

  • @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

  • @Rayangoselink
    @Rayangoselink 3 ปีที่แล้ว +1

    Dani aproves about the player object

  • @henryat1627
    @henryat1627 2 ปีที่แล้ว

    thanks, after 3 days i finally found this video

  • @thisisit.thisishowitends5181
    @thisisit.thisishowitends5181 2 ปีที่แล้ว

    Great tutorial, Dave has the best unity tutorials

  • @dumbguy1073
    @dumbguy1073 4 ปีที่แล้ว +2

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

  • @boogaan8759
    @boogaan8759 4 ปีที่แล้ว +1

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

  • @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?

  • @wormholeinteractive
    @wormholeinteractive 2 ปีที่แล้ว +3

    Amazing content and explanations!

  • @GILGIL1116
    @GILGIL1116 4 ปีที่แล้ว

    BEST PICKUP SYSTEM EVER THANK YOU SO MUCH

  • @gaminganimator-qp2ir
    @gaminganimator-qp2ir 4 ปีที่แล้ว

    Been waiting for this one

  • @spiderstudios5032
    @spiderstudios5032 3 ปีที่แล้ว

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

  • @_sidrs
    @_sidrs 4 ปีที่แล้ว +2

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

  • @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?

  • @mrreaper2425
    @mrreaper2425 4 ปีที่แล้ว +1

    Thanks man ur great help for who just start learning XD

  • @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

  • @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 🙂)

  • @D4RKTornado
    @D4RKTornado 3 ปีที่แล้ว +2

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

  • @benniegant1603
    @benniegant1603 2 ปีที่แล้ว

    Love Your Channel! Perfect!

  • @linkdev3916
    @linkdev3916 2 ปีที่แล้ว

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

    • @dcry1003
      @dcry1003 2 ปีที่แล้ว

      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 2 ปีที่แล้ว +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 2 ปีที่แล้ว +1

      @@linkdev3916 thanks rob got it working now!👍

    • @linkdev3916
      @linkdev3916 2 ปีที่แล้ว

      @@dcry1003 im glad i could help!

  • @gmangman123
    @gmangman123 2 ปีที่แล้ว

    you are legend my friend!

  • @Sputterbug
    @Sputterbug 3 ปีที่แล้ว +2

    good shit, brackeys level!

    • @aligamerable
      @aligamerable 3 ปีที่แล้ว +1

      He even sounds like him

  • @vfx_mikaliero
    @vfx_mikaliero 2 ปีที่แล้ว +2

    The type or namespace name 'ProjectileGun' could not be found (are you missing a using directive or an assembly reference?) Help me fix it!

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +2

      How is your gun script called? It either needs to be exactly "ProjectileGun" or you need to Change the variable type to whatever the name of your gun script is :D

    • @vfx_mikaliero
      @vfx_mikaliero 2 ปีที่แล้ว

      Thank you, I'll try that

  • @7PM-8
    @7PM-8 3 ปีที่แล้ว

    Really good tutorial!

  • @plawro6180
    @plawro6180 3 ปีที่แล้ว

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

  • @thestickystudio6331
    @thestickystudio6331 3 ปีที่แล้ว

    This guy might be the brackeys succesor :)

  • @ccr0co974
    @ccr0co974 2 ปีที่แล้ว +1

    my pickup class needs a return method

  • @ThePlaguedDoctorYT
    @ThePlaguedDoctorYT หลายเดือนก่อน +1

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

  • @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?

  • @fatahmadrid7806
    @fatahmadrid7806 2 ปีที่แล้ว

    Keep up monster 💜

  • @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

  • @watershub2481
    @watershub2481 3 หลายเดือนก่อน

    Thankyou so much for helping

  • @ramelsteel3782
    @ramelsteel3782 2 ปีที่แล้ว +1

    i dont get the projectilegun part what exactly is that

  • @haru-qh5fw
    @haru-qh5fw 3 ปีที่แล้ว +3

    Did anyone else get a bunch of errors when trying this?

  • @_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

  • @tomthekong3877
    @tomthekong3877 3 ปีที่แล้ว

    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.

  • @factorp2030
    @factorp2030 3 ปีที่แล้ว +3

    Why he sounds a bit like Brackeys

    • @xX_BeamCRASH_Xx
      @xX_BeamCRASH_Xx 6 หลายเดือนก่อน

      what if he was brackeys all along

  • @AZASeraph
    @AZASeraph 2 ปีที่แล้ว +1

    What if I have multiple gun scripts?

  • @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

  • @lando6583
    @lando6583 3 ปีที่แล้ว

    great video! thank you!

  • @ramnathsharma9798
    @ramnathsharma9798 4 ปีที่แล้ว +1

    Cool tutorial keep it up 😃😃👍👍

  • @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

    • @davegamedevelopment
      @davegamedevelopment  4 ปีที่แล้ว +2

      Thanks a lot! :D And glad you could fix it :D

    • @hannesberggren220
      @hannesberggren220 4 ปีที่แล้ว

      i have the same problem, could you tell me how to fix this?

  • @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!

  • @acropolise2945
    @acropolise2945 4 ปีที่แล้ว +1

    Great content!

  • @AVANIMATIONS
    @AVANIMATIONS 3 ปีที่แล้ว +1

    errors gunprojectile missing

    • @DAATChannel
      @DAATChannel 3 ปีที่แล้ว

      Same thing I’m getting

  • @a.technology1446
    @a.technology1446 4 ปีที่แล้ว

    Amazing content, thank u❤️

  • @OhioTrollerGameDev
    @OhioTrollerGameDev หลายเดือนก่อน

    THANK YOU SO MUCH!!!!!!

  • @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

  • @psbmusicfactory
    @psbmusicfactory 3 ปีที่แล้ว

    Thankyou man🙌

  • @classifiedgamer6154
    @classifiedgamer6154 4 ปีที่แล้ว

    OMG bro!
    This work thx :D.
    Can You make a video on car racing game Plz?

  • @nusayd7109
    @nusayd7109 2 ปีที่แล้ว +1

    Thank you!

  • @fateshow5303
    @fateshow5303 3 ปีที่แล้ว

    amazing ty!

  • @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.

  • @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

  • @jaggers3061
    @jaggers3061 4 ปีที่แล้ว +4

    This is a great tutorial and really helpful. Just two problems that i don’t know how to fix. When I throw my gun it slides and keeps sliding unless it hits an object. And the second problem is that my gun shrinks every time I pick it back up. Once again thank you and if you could help me fix this that would be great
    Edit: Nvm, I completely fixed all errors. Thank you

    • @davegamedevelopment
      @davegamedevelopment  4 ปีที่แล้ว +2

      K, glad it works now! :D

    • @iluz1eiluzie370
      @iluz1eiluzie370 3 ปีที่แล้ว +1

      how did you solve it I have 2 similar problems one that the gun teleports under the map if I drop it and second if I pick it up it gets like 10 times bigger

    • @flightgamer6625
      @flightgamer6625 3 ปีที่แล้ว

      @@iluz1eiluzie370 me too

    • @amees89
      @amees89 3 ปีที่แล้ว

      @@iluz1eiluzie370 I have the same problem, where it teleports... Dont know if this helps this late but: You can fix the error where it gets bigger, by only changing the size on the GunContainer, do(x:1, y:1, z:1) for the gun and just change the scale on the Container.

    • @turbulence6
      @turbulence6 2 ปีที่แล้ว +1

      @@amees89 OMG THANK YOU S O MUCH

  • @cthulhuplays6097
    @cthulhuplays6097 4 ปีที่แล้ว +2

    So a slight problem. I imported a model and now it just shrinks it after I pick it up, I tried with a model I made and one I downloaded.

    • @clearnandimprove4604
      @clearnandimprove4604 4 ปีที่แล้ว

      make sure all parents are scaled at 1 1 1. The character camera weapon and container. if you need to change the size do it from the item in the project window/ go to the model option and change scale factor to what you need.

  • @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

  • @tanphuquangxuan.1854
    @tanphuquangxuan.1854 2 ปีที่แล้ว

    nice tutorial:)

  • @meircohen1437
    @meircohen1437 4 ปีที่แล้ว +1

    love your vid thx

  • @iluz1eiluzie370
    @iluz1eiluzie370 3 ปีที่แล้ว +2

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

    • @danielmay1846
      @danielmay1846 3 ปีที่แล้ว +1

      Did you solve this please?

  • @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 9 หลายเดือนก่อน

      @@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

  • @couthdragon
    @couthdragon 2 ปีที่แล้ว +1

    this is great i did have a bug but i got i fixed

  • @snipeshotgames
    @snipeshotgames ปีที่แล้ว +2

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

  • @egzact
    @egzact 2 ปีที่แล้ว +1

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

    • @yan-sim
      @yan-sim 4 หลายเดือนก่อน

      Knife

  • @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?

  • @divyanshpathak2506
    @divyanshpathak2506 4 ปีที่แล้ว +1

    Can you please make a meelee weapon tutorial(I need that for my game)
    And your tutorials are the best man'

    • @davegamedevelopment
      @davegamedevelopment  4 ปีที่แล้ว +1

      Yeah, I would love to learn more about sword fighting myself :D Once I made a proper system I'll probably make a tutorial! :D

    • @divyanshpathak2506
      @divyanshpathak2506 4 ปีที่แล้ว +1

      @@davegamedevelopment Please do it fast...I need it...You are the only one from who I can expect anything AWESOME.

    • @gaminganimator-qp2ir
      @gaminganimator-qp2ir 4 ปีที่แล้ว +1

      @@davegamedevelopment its treu ur the best

    • @davegamedevelopment
      @davegamedevelopment  4 ปีที่แล้ว +1

      @@gaminganimator-qp2ir Thanks! :D

    • @gaminganimator-qp2ir
      @gaminganimator-qp2ir 4 ปีที่แล้ว

      @@davegamedevelopment also thanks to u