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 movement 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: kzbin.info/www/bejne/oGO8oZ-foa2deaM Thanks so much for watching, hope this tutorial has helped you!
@Maskeowl11 ай бұрын
Is there a better collision control method for fast moving objects?
@curtissmith755Ай бұрын
Hello I have a question about the projectileAddon. When I throw it's sticking on the camera or maybe the player. How do I fix that so it could stick on surface and not the player
@Kevinaya2 жыл бұрын
Let's goooo Dave remembered he had a KZbin channel XD. It only took him a year to figure it out 🤣
@liamtoh63812 жыл бұрын
out of all the other tutorials I, ve seen, this has been the most understandable. looking forward to see and learn more :3
@davegamedevelopment2 жыл бұрын
Thanks a lot, glad I could help!
@Gszada2 жыл бұрын
Dude, you are now my favorite game dev to watch. I was just wondering how to make projectiles stick to objects and I saw your video. Great stuff... Keep it up!
@davegamedevelopment2 жыл бұрын
Thank you so much, really appreciate it!
@greenwandgaming94512 жыл бұрын
When the world need him the most , he returned.
@xeno50312 жыл бұрын
When the world needed him the most
@soslowman9 ай бұрын
IF YOUR BULLETS STICK TO THE PLAYER: move the bullet spawn point to the right (or left) from the player model and make it a child of the orientation object If your spawn point is within the player model the OnCollisionEnter function instantly makes bullets kinematic which results in weird behaviour If you move the spawn point out of the player model, it still won't move, which results in a bug that looks like you're changing hands, which fixes if you add it as a child to the orientation
@wilsonandco-28902 жыл бұрын
I think throwing items is a perfect fit for dealing with violent enemies in the non violent game i'm making, thank you.
@davegamedevelopment2 жыл бұрын
Glad I could help! :D
@decidev2 жыл бұрын
Glad to have u back bro, you motivated me a lot to keep making games and your tutorials are some of the best on KZbin!
@davegamedevelopment2 жыл бұрын
Thank's a lot! Glad I could help!
@bradb51292 жыл бұрын
Glad to see you back, I still use your gun script tutorial whenever I make a FPS game.
@davegamedevelopment2 жыл бұрын
That's nice to hear, glad I could help!
@xcraft86 Жыл бұрын
I have to say, this is the best projectile tutorial that I came across. I'm subbing this with premium!
@cgnotavailable2 жыл бұрын
You're back!!🤩🤩
@davegamedevelopment2 жыл бұрын
Yes, finally!
@gmangman1232 жыл бұрын
Another good tutorial again! Thx my friend
@hackpurgaming69472 жыл бұрын
Finally, he remembered his channel's password! 😂😂 BTW Welcome Back To KZbin! 💖💖
@davegamedevelopment2 жыл бұрын
Yeah took me a while to figure the password out... Thanks for welcoming me back!
@juliaalder20072 жыл бұрын
Could you please show us how to do if with the new Input System?
@davegamedevelopment2 жыл бұрын
@@juliaalder2007 I answered your other comment :D
@drinkwatrr98832 жыл бұрын
Good to see you back my man
@davegamedevelopment2 жыл бұрын
Thanks!
@AryanSingh-us5ej2 жыл бұрын
I was Looking To make a cannon, This works for me. Thnx :)
@gameboardgames10 ай бұрын
Omg wish I saw this last week. I've been trying to get a good throw arc for a game object by rewriting a script that moves an object up, then down at the height of the arc, and also moves the object to the side, decreasing distance over time, and then has another component which adds spin. Ughgh. Subscribing...
@TeamMajonez2 жыл бұрын
your tutorials are amazing :)
@davegamedevelopment2 жыл бұрын
Thanks a lot!
@simpledeck51332 жыл бұрын
Thank god your back took to A YEAR
@jfierro1394 Жыл бұрын
I followed everything exact and have reviewed several times. The object does not get thrown. Any ideas on what I may be missing or need to change?
@ops28372 жыл бұрын
Hey dave can you please make a tutorial about playing an animation on a keypress
@vinyas07952 жыл бұрын
Finally you are back 👏🏻
@kraccbaccoriginal2 жыл бұрын
Finally you're back 😁
@darkrehart2 жыл бұрын
THE LEGEND IS BACK!!
@davegamedevelopment2 жыл бұрын
Finally! :D
@vievienu-2903 Жыл бұрын
i had a problem with when i tried to implement the stick the balls i was using tuened into lines and just stuck in the air. i then turned off gravbity and they stuck to surfaces but disformed a huge amount. if i aimed too close to my body they would also stick almost on me
@sunthejr Жыл бұрын
What did you do
@mishaaskar Жыл бұрын
had the same problem, for anyone expiriencing this after me: delete the first object u made a prefab off so its not an actuall game object in your level (if it is it will turn kinematic when it hits the ground and so wil be all you other thrown objects)and to refrence it in the player throwing tutorial script just drag the prefab. @@sunthejr
@squidgibow17715 күн бұрын
I have the same problem too, currently working on what I did wrong. Something I noticed though, if I manage to shoot two into the air and they collide, they will remain suspended. Not only that, but the disforming doesn't happen when they collide with themselves and the ground is not a factor in the collision. Not sure what this is
@nessblx2 жыл бұрын
HOLY CRAP HE'S BACK!11!!!!1!!!!!
@davegamedevelopment2 жыл бұрын
:D
@mrworldwide91722 жыл бұрын
he is back guys
@davegamedevelopment2 жыл бұрын
Finally :D
@yahyahayatyahya99252 жыл бұрын
Welcome Back!
@davegamedevelopment2 жыл бұрын
Thanks!
@rkpmakes2 жыл бұрын
You’re back!!!!!!!!!
@soksopanha73482 жыл бұрын
Legend is back!!!!!
@Dorbellprod2 жыл бұрын
I missed you Dave Game Development
@davegamedevelopment2 жыл бұрын
Ah I remember you, glad you're still active :D
@shubhsharma62342 жыл бұрын
Your back 👏👏
@TheHUMAN-e8r5 ай бұрын
I have already done the basic enemy script and the projectile addon but the basic enemy in the projectile addon is wrong
@TheKr0ckeR Жыл бұрын
Thank you. Why are we adding transform.up to the calculation? We are already calculating the direction with raycast. Do we need that actually?
@MatejSunavec Жыл бұрын
To not get "Hides inherited member warning" you new to set up "public Transform cam"; to "public new Transform cam;" My projectile is stuck in the air, I do not know how to fix it.
@SuperMillwall9 ай бұрын
How would I go about making the throw similar to a Dart being thrown on a Dartboard? If I copy the “Arrow” values, it still doesn’t look like a Dart throw. Not only that but I have a ”Crosshair” where I want the Dart to be thrown.. However if I use the “Arrow” setup, the Dart always throws above the “Crosshair” Any idea what I can do?
@darkdoom9072 жыл бұрын
4:10, Vector Dir
@2ksp2352 жыл бұрын
Awesome. How can i make a boss for example look at me and shoot. Let us say the bos is simply rotating like a tower and shoot at you . I am learning to code and unity pls
@davegamedevelopment2 жыл бұрын
I have an entire video on creating enemy Ai, in there I even explain how you can make your boss chase the player
@2ksp2352 жыл бұрын
@@davegamedevelopment It is good to see you back :) Thx
@paininkabir47608 ай бұрын
Hey. How can I throw objects to the direction of my pointer? I mean I am making a game with a stable camera and I wanna throw to the direction the user clicks
@iguessimagamer30182 жыл бұрын
He's back,🥺
@kholex9 ай бұрын
How can you implement this into multiplayer for example photon pun?
@eldrano9510 Жыл бұрын
when I add the script to the throwable object, it doesn't get thrown anymore it just gets put in the air in front of me. Besides it's super small and I can't figure out why.
@dertobbe1176 Жыл бұрын
Doesnt work for me. Grenade just behaves like you drop it. It instantiate at the right point but no force is added to it. Any ideas?
@emilianogallardo63872 жыл бұрын
Gracias por el video, 😃
@jaredmarrero52512 жыл бұрын
For anyone in 2022 and beyond struggling to get your projectile to throw STRAIGHT follow these steps: *Above "GameObject projectile = Instantiate" put: "Quaternion q = Quaternion.FromToRotation(Vector3.up, transform.forward); objectToThrow.transform.rotation = q * attackPoint.transform.rotation;" and then in "GameObject projectile = Instantiate(objectToThrow, attackPoint.position, objecTothrow.rotation);" change "objectTothrow.rotation" to ---> "q" or the name of the quaternion that you made in the line before.* You're ensuring the projectile has the same rotation as your attack point. In the editor, ensure your attack point represents the angle at which you want your 3D object to shoot with. Also ensure to move your attack position to where you want your clone to spawn. THANKS FOR ALL YOU'VE GIVEN US LORD DAVE :)
@davegamedevelopment2 жыл бұрын
Appreciate the help you're providing! :D
@saraschroder75232 жыл бұрын
Thank you so much! I have my projectiles shooting straight now but no matter what rotation I put on the attack point the projectile shoots towards the ground. Any suggestions?
@ziot79922 жыл бұрын
thank you!!!
@a_protato87022 жыл бұрын
when I throw the spheres they stick but the splat to the wall? like they become flat idk why.
@davegamedevelopment2 жыл бұрын
Could it be that the wall transform is really stretched out (scale is uneven, something like 1 1 7)
@a_protato87022 жыл бұрын
@@davegamedevelopment That seems to be the reason, but how would I fix it without changing the wall?
@wearepivotstick11 ай бұрын
Dude, the object I'm trying to throw spawns too high and falls without being thrown. I made the settings, but it didn't work.
@unholy_seagul2 жыл бұрын
i didnt see who posted this video, and for the first 5 seconds i couldve sworn it was brackeys
@davegamedevelopment2 жыл бұрын
Haha, I'll take it as a compliment :D
@Spermoludek0grudek2 жыл бұрын
i want to make like changeable weapons by pressing numers 1 2 3 how do i do that
@justbrycefr Жыл бұрын
how do you make them despawn after a few seconds
@balqisismail4555 Жыл бұрын
hello, i wanna ask. is it working for vr gaming?
@mahicans24782 жыл бұрын
Dave are you able to make a portal gun tutorial
@davegamedevelopment2 жыл бұрын
Maybe I'll make one, but for now, Brackeys has quite a good Portal Tutorial
@angrychompski Жыл бұрын
wirklich sehr interessant
@juliaalder20072 жыл бұрын
Cool. 😀 Could you do this with the new input system?
@GymCritical2 жыл бұрын
Of course!
@juliaalder20072 жыл бұрын
@@GymCritical Could you please show us how?
@GymCritical2 жыл бұрын
@@juliaalder2007 I’m not making videos right now.
@davegamedevelopment2 жыл бұрын
You can, it just takes a bit longer to set up :D Basically just follow along with this tutorial, and then call the Throw() function in your input Script. kzbin.info/www/bejne/hqvHaYGemLetjNE
@juliaalder20072 жыл бұрын
@@davegamedevelopment There is no Throw() function in Brackeys tutorial. 🙁
@GhostSAS72252 жыл бұрын
Hey Dave! I know it's not related to the (current) video but, since (it's completely understandable) you don't reply anymore at the comments on the wallrun video, I have a question, I downloaded your script and if I disable double jumps I can't jump to the left or right wall cause my jump speed is too low and I just fall off, what can I do?
@Sponge2212 Жыл бұрын
Happened to me too, I figured out that you actually have to code it and the download is useless
@GBG_532010 ай бұрын
is there a way to rotate the prefab? when it spawns the arrow is pointed up
@oliverqueen56358 ай бұрын
Were you able to find a solution? Edit: (This was a solution posted by @jaredmarrero5251) "For anyone in 2022 and beyond struggling to get your projectile to throw STRAIGHT follow these steps: *Above "GameObject projectile = Instantiate" put: "Quaternion q = Quaternion.FromToRotation(Vector3.up, transform.forward); objectToThrow.transform.rotation = q * attackPoint.transform.rotation;" and then in "GameObject projectile = Instantiate(objectToThrow, attackPoint.position, objecTothrow.rotation);" change "objectTothrow.rotation" to ---> "q" or the name of the quaternion that you made in the line before.* You're ensuring the projectile has the same rotation as your attack point. In the editor, ensure your attack point represents the angle at which you want your 3D object to shoot with. Also ensure to move your attack position to where you want your clone to spawn."
@Sam-cq9bj2 ай бұрын
Hey dude! Nice tutorial, man! How can I contract you?
@TheHUMAN-e8r5 ай бұрын
my objects dont work they just stick to me and they are just still
@Jaydenbb5 Жыл бұрын
Is there any fix for objects thrown downward sticking to the player? I tried fixing it myself but nothing I seemed to do worked right
@loden_games Жыл бұрын
Check the tag of the object you collided with. Inside the OnCollisionEnter script put your code into either of these if statements: if (collision.gameObject.tag != "Player") { ... } if (collision.gameObject.tag == "Stickable") { ... } Make sure to tag your gameobject as player or walls that you want stickable as Stickable
@Jaydenbb5 Жыл бұрын
@@loden_games christ I'm surprised I didn't think of that. Thank you
@aegiberry5890 Жыл бұрын
i have question, when first time making this project, do u click "FPS" or "3D" on create new project?
@marcoshope7622 Жыл бұрын
3D
@alonzohedgehog2 жыл бұрын
would it be possible to make the spawned cloned angled differently somehow? my knife keeps spawning in with the blade pointing up rather than forward
@snipermonkey4272 жыл бұрын
YES
@davegamedevelopment2 жыл бұрын
YES
@snipermonkey4272 жыл бұрын
@@davegamedevelopment I’ve been dying for a 3D boss fight tutorial, it would be awesome if you could do that. Keep up the great vids.
@davegamedevelopment2 жыл бұрын
@@snipermonkey427 Definitely thinking about that, cool idea :D
@Zigglot Жыл бұрын
Bro I wanted a good Movement script brackeys u can change directions weirdly in mid air others confusing and this one... well this one is AMAZING best series ever bro LEGEND!!!
@davegamedevelopment Жыл бұрын
Thanks so much, glad you like it!
@WilliamAlex2 жыл бұрын
your voice is changed! do you practice? Dave?
@davegamedevelopment2 жыл бұрын
Thanks, it just changed naturally I think. Also my English got a bit better (At least I hope so) :D
@Kevinaya2 жыл бұрын
What was the reason you didn't upload for a whole year?
@davegamedevelopment2 жыл бұрын
I switched from game development to website development for a while and after that just didn't have the motivation to continue with this channel. But now I'm looking forward to uploading here regularly again. :D
@Kevinaya2 жыл бұрын
@@davegamedevelopment I also lost my motivation and haven't opened unity in over 3months :( just can't get it back. I probably think it's because I've been sticking only one one project and not start a new one untill it's finished. Maybe I should start multiple projects so I don't get bored doing the same project 🤔
@nuggetman10232 жыл бұрын
i have ben trying to do a no collision with my body for a solid hour i thought it would be a good idea to try and ask you guys if you know a way to make it so a specific item dose not collide with a player character.
@KrangAnimations2 жыл бұрын
POV: brackeys is gone
@davegamedevelopment2 жыл бұрын
Haha :D
@KrangAnimations2 жыл бұрын
@@davegamedevelopment also just in case it sounded like I was being mean I swear I wasn’t. I’m really glad you have these tutorials on here because they help a lot of people. Keep up the good work and don’t forget about your channel for another year 😂👍
@davegamedevelopment2 жыл бұрын
@@KrangAnimations Thanks a lot!
@miguelclemente49792 жыл бұрын
I made my projectile into a cube and whenever it gets parented to the wall/ground, it skews. Any way to fix this?
@twist4742 жыл бұрын
how do i delete the knife after some time
@retrospect8403 Жыл бұрын
I'm sure you've probably figured it out by now but you would use the following code Object.Destroy(projectile, 5f); so it just destroys the prefab after a set amount of time
@csr38462 жыл бұрын
Great videos! I'm unable to join your discord server though. it says, "Cannot accept invite".
@Gurem7 ай бұрын
Bug: hit.position - attackPoint.position Fix: attackPoint.position - hit.position For anyone watching this is the actual fix for things spawning behind. Because this is reversed you will spawn things in the wrong direction if ur spawner is infornt the camera but with this fix it wont matter where the spawner is.
@thunderhawk45922 жыл бұрын
would this work in third person
@davegamedevelopment2 жыл бұрын
Yes, you just need to change the camera script
@umwhatt Жыл бұрын
Hey, I used your exact code, but when I threw the threw the throwing object, it would stay in place. I know what's doint it, but I don't know how. When I remove the "Projectile addon" script, it works just fine. but when I add it, The throwable objects don't throw. Edit, I found out its because the clones of the throwing item spawn in the attack point, but i dont know how to fix
@davegamedevelopment Жыл бұрын
Are you Instantiating correctly? Don't use Instantiate(object, parent), but rather Instantiate(object, position, rotation), then it shouldn't be parented to anything
@forrestarnold14022 жыл бұрын
Error: My player moves when he throws the object it could be colliding and pushing him, or he could be moving due to some sort of movement error idk
@forrestarnold14022 жыл бұрын
i think it may have to do with my player's force being affected by the throw object
@awiseauthor3456 Жыл бұрын
move the "attackPoint" game object slightly forward, that should keep the object from hitting your player
@retrospect8403 Жыл бұрын
I had the same issue, if the other suggestions haven't worked have you checked that when referencing the projectile rigidbody, that its Rigidbody projectileRb = projectile.GetComponent(); instead of Rigidbody projectileRb = GetComponent();? that fixed it for me
@RossTubes2 жыл бұрын
so everything finally works but when i change the gravity of the object to throw to true it just gets stuck in the air for no reason cuz when i change the box collider to trigger it works perfectly but now my object is going through the wall and or ground how can i put the gravity on without falling through objects?
@nathanr85152 жыл бұрын
i new to unity in general but this isn't that confusing the only problem that i am having is that the knife isnt doing damage or sticking to things i have all of the scripts in the right places and everything
@davegamedevelopment2 жыл бұрын
Maybe download the project file over my discord server and see how everything is set up? It's most likely a problem with the OnCollisionEnter function not being called.
@NotTolik7082 жыл бұрын
are you make collider for knife?
@CabinetManHeeHee Жыл бұрын
for some reason when I add the projectile addon script the ball stops getting thrown and I can't move forwards, can anybody help fix this issue
@GeForce_IV Жыл бұрын
the projectile goes towards the player
@pietrastak956411 ай бұрын
you got a fix for that?
@GeForce_IV11 ай бұрын
@@pietrastak9564 nah i just gave up and used another throwing systen
@amirmollaei56812 жыл бұрын
How do I download the grenade version?
@harharrr98102 жыл бұрын
does it work for third person character too??
@magic46712 жыл бұрын
My unity just crashes when i try to add the throw script to my player. Any idea how to fix this?
@davegamedevelopment2 жыл бұрын
When you add it? Normally that can only happen when you execute a script that has some kind of infinite loop in it. So it's eighter a problem of your Unity program or you made some mistakes with the code :D
@magic46712 жыл бұрын
@@davegamedevelopment I messed up the code, Its fixed now thanks.
@SD-Gamer Жыл бұрын
your voice like brackeys. brackeys come with real account !
@Witcherhere112 Жыл бұрын
you sound like brackeys
@vahidhussain85492 жыл бұрын
I cant seem to shoot the arrows properly at the pointed end. It is throwing arrows horizontally.
@jaredmarrero52512 жыл бұрын
For anyone in 2022 and beyond struggling to get your projectile to throw STRAIGHT follow these steps: *Above "GameObject projectile = Instantiate" put: "Quaternion q = Quaternion.FromToRotation(Vector3.up, transform.forward); objectToThrow.transform.rotation = q * attackPoint.transform.rotation;" and then in "GameObject projectile = Instantiate(objectToThrow, attackPoint.position, objecTothrow.rotation);" change "objectTothrow.rotation" to ---> "q" or the name of the quaternion that you made in the line before.* You're ensuring the projectile has the same rotation as your attack point. In the editor, ensure your attack point represents the angle at which you want your 3D object to shoot with. Also ensure to move your attack position to where you want your clone to spawn.
@snipermonkey4272 жыл бұрын
Yoooooooooooo
@genericbinary5582 жыл бұрын
in 4:24 I plugged out my earphones and plugged in again. 🙂
@spncrszn2 жыл бұрын
I cant seem to get it to work the damage doesnt work and the knifes thrown dont stick to the targets
@olivermasiala22802 жыл бұрын
I’m having a bug I can’t throw my knife correctly because it’s only come on the vertical
@jaredmarrero52512 жыл бұрын
For anyone in 2022 and beyond struggling to get your projectile to throw STRAIGHT follow these steps: *Above "GameObject projectile = Instantiate" put: "Quaternion q = Quaternion.FromToRotation(Vector3.up, transform.forward); objectToThrow.transform.rotation = q * attackPoint.transform.rotation;" and then in "GameObject projectile = Instantiate(objectToThrow, attackPoint.position, objecTothrow.rotation);" change "objectTothrow.rotation" to ---> "q" or the name of the quaternion that you made in the line before.* You're ensuring the projectile has the same rotation as your attack point. In the editor, ensure your attack point represents the angle at which you want your 3D object to shoot with. Also ensure to move your attack position to where you want your clone to spawn.
@utkarshkumar8593 Жыл бұрын
@@jaredmarrero5251 Hi Jared, tried your solution but I have having issues my spheres are going straight but only in one direction i rotate cam the sphere spawns at the attackPoint new rotated position but the sphere instead of going in backward direction goes in the previous direction raycast hitted. Any solutions?
@bnkm072 жыл бұрын
i want to do this in godot but there is no tutorial
@logmac27352 жыл бұрын
Knives are facing in the other direction while I throw.
@ziot79922 жыл бұрын
same, did you find a solution?
@dekenfnombre91432 жыл бұрын
sound like Brackey
@zachhoffman51422 жыл бұрын
Got lost,didn’t work,and gave up
@shinshogamer51 Жыл бұрын
it sucks
@EMB3D2 ай бұрын
how come that the throwables don't collide with the player capsule?