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!
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 :)
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 ?
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.
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.
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!
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
@@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
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!
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
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!
@@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?
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
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
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
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?
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?
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
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 🥺
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.
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
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.
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?
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;
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.
@@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.
@@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.
@@_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
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.
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
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.
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)
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?*
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;
@@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
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
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?
@@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.
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.
@@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
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.
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
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
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 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
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?
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!
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 :)
Thank you so much! :D
@@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 😁😁
I almost cried as it worked, i spent over 10h on it
I feel you man... Sometimes coding stuff takes wayy too long :D
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 ?
Input.GetMouseButtonDown(1)
@Domantuso_gaming mate can you just say fuck and shit without censoring it
@@developer2 lmao
Set Interpolate to :None
if your object is not moving as your view camera.
Thanks a lot
thank u so much i was about to restart
Thankyou sooooooo muchhhhhhhhhhhhhhhhhhhh 😭😭😭😭
You are the life saver
This man deserves more support his tutorials are amazing! I’m writing this comment to show all the support I can!
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.
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
thx
you are a life saver
thx
thank you from Russia😁
Thanks
:D
top 10% of Unity tutorials right here, and I've sure as hell watched pretty much all of them
This Guy Is A Such A Good Person, He Gives The Codes And Understands We Easily
Thanks a lot!
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.
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
Glad it helped you! Thanks for watching :D
@@davegamedevelopment thanks for doing it
Gotta say man seriously good content unlike any other youtuber! keep it up!
You my good sir is a legend among this community, insane tutorial💪🏻
Mannn this is such an amazing tutorial! everything worked perfectly at one go! I wish you all the best with your channel!
are you using his movement system and if so where does the guncontainer go to?
@@itzdimi7569 I'm not using his movement system...but my gun container is the child of my camera
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!
my game just became 1 step closer 2 done. Thank you so much for this tutorial!
That's nice to hear, glad I could help!
Coming back to these tutorials after learning c# and they are so much easier to understand!
same.
super well done man! Even though it's almost a 2 year old video it helped me a lot.
Glad you like it!
You are the best! I hope you keep making these tutorials!!!!
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
Thankyou so much Dave, works very well making my game so much better!
Glad I could help!
@@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
Absolutely amazing, thank you so much, my player can now pick up a flashlight in my horror game! 😁
Great tutorial, Dave has the best unity tutorials
Very nice
Used it in my.personal project.
Working well
Enjoying playing with the script.
Thanks a lot, glad you like it! :D
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!
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
@@davegamedevelopment slerp
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!
@@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?
@@zeaglee3432 says currentWeapon doesnt exist
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
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
@@davegamedevelopment All good, just got a different tutorial for pick up and drop thanks for replying
Thanks you so much i keep finding this tutorial
No problem :D Congrats for first comment btw :D
@@davegamedevelopment you are an amazing guy (;
@@imzary Thanks :D
@@davegamedevelopment np :D
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
Thanks for the help. Took 15 minutes and works great
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?
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?
First tutorial with pick up and drop combined. Thxx for that. Without this i would die
Haha, glad they could help you! :D
My god, thank you soooooo much for adding the script download!!!!! :)))
No problem :D
Amazing content and explanations!
Thanks!
there u go mate ur new sub and a follower...i like ur content keep posting more..all the best
Thank you so much! :D
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
the only thing that works is the throw machinic which gets thrown from a far distance
I set the rigidbdy to extrapolate and continous dynamic but it still bugs?
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 🥺
You need to take the exact name of your gun script (The one that makes your gun shoot :D)
@@davegamedevelopment yup I found out yesterday lol thanks for the reply
@@davegamedevelopment im confused, i try to rename it but it says that there is already a script with the same name
@@ezrawrx You probably used a name that's already used by Unity (like System, Input etc.) :D
Try changing it :D
Dave / GameDevelopment thank you so much!
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.
Thanks! Glad I could help!
This video is much better than the others cuz now he's showing hierarchy
thanks, after 3 days i finally found this video
i dont get the projectilegun part what exactly is that
BEST PICKUP SYSTEM EVER THANK YOU SO MUCH
You are just awesome dude !!! Thanks !!!
Thanks a lot! Glad you liked it! :D
Thank you so much! This worked for me! You've earned my sub!
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.
You need to set the "Equipped" bool correctly before you start the game :D
Dave / GameDevelopment K, thanks a lot
you explained it that good i even did it in 2D game.
Thanks man ur great help for who just start learning XD
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
Been waiting for this one
errors gunprojectile missing
Same thing I’m getting
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.
thank you so much
@@JrMinalga np
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?
Im also facing the same issue pls some one help
Lucky For you I just found the solution, in the rigid body just use interpolate as none it fixes it
@@sdp_studios Thanks
@@sdp_studios Love you. My hero.
@@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
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;
Thanks bro that really helps me out
whenever i pick it up after throwing it down it for some reason grows gigantic
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 🙂)
Thanks a lot! Glad they helped you :D
Love Your Channel! Perfect!
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.
I had the same problem, have you solved this yet please?
I've the same problem and I still can't fix it. I think he will never respond again :(
@@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.
@@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.
@@_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
omg thanks so much for this, you helped me alot!
What if I have multiple gun scripts?
do i put the code in the player or the item?
On the player object
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
Can you do this with other objects other than guns if we change the gunscript
Cool tutorial keep it up 😃😃👍👍
Thanks a lot! :D
:)
Dani aproves about the player object
good shit, brackeys level!
He even sounds like him
I loved this, its exaclty what i needed!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Glad you liked it, thanks for watching! :D
Dave / GameDevelopment thanks for hearting my comment
if I drop mine it goes under the map itself any ideas?
Did you solve this please?
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.
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
@@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?
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.
Thnx buddy. It helped me a lot
Bruh, Lifesaver
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
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)
@@gaminganimator-qp2ir some people don’t know how to script yet
Really good tutorial!
Gun script is a separate class with properties and methods?
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?
great video! thank you!
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?*
That was so awesome!
AMAZING!!! I THOUGHT IT WOULDNT WORK BECAUSE I HAVE A WHOLE DIFFERENT MOVEMENT AND CAMERA SYSTEM BUT IT DID, YOURE DOPE
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;
@@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
@@linkdev3916 thanks rob got it working now!👍
@@dcry1003 im glad i could help!
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
Did you find a solution?
Thankyou so much for helping
GunSystem Script is not working.
It is showing camshake is missing
HELP!
idk what to replace ProjectileGun with??????????
Knife
Amazing content, thank u❤️
Glad you like it! :D
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?
Make sure that your weapon holder is a child of the camera :D
@@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.
you are legend my friend!
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?
Did you solve this please??
Can you tell us how to make the bullets actually do damage
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
where i should put the second gun?? does the second gun would be in the gun container or??
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.
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);
ty (,: for making this tutorial can i ask what music you use ?
Links in the description :D
@@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
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.
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
Thanks a lot! :D And glad you could fix it :D
i have the same problem, could you tell me how to fix this?
This guy might be the brackeys succesor :)
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
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
Sorry I'm currently learning Photon2 myself (also for a multiplayer game), so I don't have much knowledge about networking :D
@@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
@@davegamedevelopment would love to see how you managed this!
Thankyou man🙌
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?
Why he sounds a bit like Brackeys
what if he was brackeys all along
Where are you now?? You u are not uploading anything? You just disappeared.