THROWING Grenades, Knives and Other Objects - Unity Tutorial

  Рет қаралды 92,448

Dave / GameDevelopment

Dave / GameDevelopment

Күн бұрын

Пікірлер: 164
@davegamedevelopment
@davegamedevelopment Жыл бұрын
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!
@Maskeowl
@Maskeowl 11 ай бұрын
Is there a better collision control method for fast moving objects?
@curtissmith755
@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
@Kevinaya
@Kevinaya 2 жыл бұрын
Let's goooo Dave remembered he had a KZbin channel XD. It only took him a year to figure it out 🤣
@liamtoh6381
@liamtoh6381 2 жыл бұрын
out of all the other tutorials I, ve seen, this has been the most understandable. looking forward to see and learn more :3
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Thanks a lot, glad I could help!
@Gszada
@Gszada 2 жыл бұрын
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!
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Thank you so much, really appreciate it!
@greenwandgaming9451
@greenwandgaming9451 2 жыл бұрын
When the world need him the most , he returned.
@xeno5031
@xeno5031 2 жыл бұрын
When the world needed him the most
@soslowman
@soslowman 9 ай бұрын
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-2890
@wilsonandco-2890 2 жыл бұрын
I think throwing items is a perfect fit for dealing with violent enemies in the non violent game i'm making, thank you.
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Glad I could help! :D
@decidev
@decidev 2 жыл бұрын
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!
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Thank's a lot! Glad I could help!
@bradb5129
@bradb5129 2 жыл бұрын
Glad to see you back, I still use your gun script tutorial whenever I make a FPS game.
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
That's nice to hear, glad I could help!
@xcraft86
@xcraft86 Жыл бұрын
I have to say, this is the best projectile tutorial that I came across. I'm subbing this with premium!
@cgnotavailable
@cgnotavailable 2 жыл бұрын
You're back!!🤩🤩
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Yes, finally!
@gmangman123
@gmangman123 2 жыл бұрын
Another good tutorial again! Thx my friend
@hackpurgaming6947
@hackpurgaming6947 2 жыл бұрын
Finally, he remembered his channel's password! 😂😂 BTW Welcome Back To KZbin! 💖💖
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Yeah took me a while to figure the password out... Thanks for welcoming me back!
@juliaalder2007
@juliaalder2007 2 жыл бұрын
Could you please show us how to do if with the new Input System?
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
@@juliaalder2007 I answered your other comment :D
@drinkwatrr9883
@drinkwatrr9883 2 жыл бұрын
Good to see you back my man
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Thanks!
@AryanSingh-us5ej
@AryanSingh-us5ej 2 жыл бұрын
I was Looking To make a cannon, This works for me. Thnx :)
@gameboardgames
@gameboardgames 10 ай бұрын
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...
@TeamMajonez
@TeamMajonez 2 жыл бұрын
your tutorials are amazing :)
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Thanks a lot!
@simpledeck5133
@simpledeck5133 2 жыл бұрын
Thank god your back took to A YEAR
@jfierro1394
@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?
@ops2837
@ops2837 2 жыл бұрын
Hey dave can you please make a tutorial about playing an animation on a keypress
@vinyas0795
@vinyas0795 2 жыл бұрын
Finally you are back 👏🏻
@kraccbaccoriginal
@kraccbaccoriginal 2 жыл бұрын
Finally you're back 😁
@darkrehart
@darkrehart 2 жыл бұрын
THE LEGEND IS BACK!!
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Finally! :D
@vievienu-2903
@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
@sunthejr Жыл бұрын
What did you do
@mishaaskar
@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
@squidgibow177
@squidgibow177 15 күн бұрын
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
@nessblx
@nessblx 2 жыл бұрын
HOLY CRAP HE'S BACK!11!!!!1!!!!!
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
:D
@mrworldwide9172
@mrworldwide9172 2 жыл бұрын
he is back guys
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Finally :D
@yahyahayatyahya9925
@yahyahayatyahya9925 2 жыл бұрын
Welcome Back!
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Thanks!
@rkpmakes
@rkpmakes 2 жыл бұрын
You’re back!!!!!!!!!
@soksopanha7348
@soksopanha7348 2 жыл бұрын
Legend is back!!!!!
@Dorbellprod
@Dorbellprod 2 жыл бұрын
I missed you Dave Game Development
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Ah I remember you, glad you're still active :D
@shubhsharma6234
@shubhsharma6234 2 жыл бұрын
Your back 👏👏
@TheHUMAN-e8r
@TheHUMAN-e8r 5 ай бұрын
I have already done the basic enemy script and the projectile addon but the basic enemy in the projectile addon is wrong
@TheKr0ckeR
@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
@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.
@SuperMillwall
@SuperMillwall 9 ай бұрын
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?
@darkdoom907
@darkdoom907 2 жыл бұрын
4:10, Vector Dir
@2ksp235
@2ksp235 2 жыл бұрын
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
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
I have an entire video on creating enemy Ai, in there I even explain how you can make your boss chase the player
@2ksp235
@2ksp235 2 жыл бұрын
@@davegamedevelopment It is good to see you back :) Thx
@paininkabir4760
@paininkabir4760 8 ай бұрын
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
@iguessimagamer3018
@iguessimagamer3018 2 жыл бұрын
He's back,🥺
@kholex
@kholex 9 ай бұрын
How can you implement this into multiplayer for example photon pun?
@eldrano9510
@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
@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?
@emilianogallardo6387
@emilianogallardo6387 2 жыл бұрын
Gracias por el video, 😃
@jaredmarrero5251
@jaredmarrero5251 2 жыл бұрын
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 :)
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Appreciate the help you're providing! :D
@saraschroder7523
@saraschroder7523 2 жыл бұрын
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?
@ziot7992
@ziot7992 2 жыл бұрын
thank you!!!
@a_protato8702
@a_protato8702 2 жыл бұрын
when I throw the spheres they stick but the splat to the wall? like they become flat idk why.
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Could it be that the wall transform is really stretched out (scale is uneven, something like 1 1 7)
@a_protato8702
@a_protato8702 2 жыл бұрын
@@davegamedevelopment That seems to be the reason, but how would I fix it without changing the wall?
@wearepivotstick
@wearepivotstick 11 ай бұрын
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_seagul
@unholy_seagul 2 жыл бұрын
i didnt see who posted this video, and for the first 5 seconds i couldve sworn it was brackeys
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Haha, I'll take it as a compliment :D
@Spermoludek0grudek
@Spermoludek0grudek 2 жыл бұрын
i want to make like changeable weapons by pressing numers 1 2 3 how do i do that
@justbrycefr
@justbrycefr Жыл бұрын
how do you make them despawn after a few seconds
@balqisismail4555
@balqisismail4555 Жыл бұрын
hello, i wanna ask. is it working for vr gaming?
@mahicans2478
@mahicans2478 2 жыл бұрын
Dave are you able to make a portal gun tutorial
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Maybe I'll make one, but for now, Brackeys has quite a good Portal Tutorial
@angrychompski
@angrychompski Жыл бұрын
wirklich sehr interessant
@juliaalder2007
@juliaalder2007 2 жыл бұрын
Cool. 😀 Could you do this with the new input system?
@GymCritical
@GymCritical 2 жыл бұрын
Of course!
@juliaalder2007
@juliaalder2007 2 жыл бұрын
@@GymCritical Could you please show us how?
@GymCritical
@GymCritical 2 жыл бұрын
@@juliaalder2007 I’m not making videos right now.
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
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
@juliaalder2007
@juliaalder2007 2 жыл бұрын
@@davegamedevelopment There is no Throw() function in Brackeys tutorial. 🙁
@GhostSAS7225
@GhostSAS7225 2 жыл бұрын
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
@Sponge2212 Жыл бұрын
Happened to me too, I figured out that you actually have to code it and the download is useless
@GBG_5320
@GBG_5320 10 ай бұрын
is there a way to rotate the prefab? when it spawns the arrow is pointed up
@oliverqueen5635
@oliverqueen5635 8 ай бұрын
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-cq9bj
@Sam-cq9bj 2 ай бұрын
Hey dude! Nice tutorial, man! How can I contract you?
@TheHUMAN-e8r
@TheHUMAN-e8r 5 ай бұрын
my objects dont work they just stick to me and they are just still
@Jaydenbb5
@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
@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
@Jaydenbb5 Жыл бұрын
@@loden_games christ I'm surprised I didn't think of that. Thank you
@aegiberry5890
@aegiberry5890 Жыл бұрын
i have question, when first time making this project, do u click "FPS" or "3D" on create new project?
@marcoshope7622
@marcoshope7622 Жыл бұрын
3D
@alonzohedgehog
@alonzohedgehog 2 жыл бұрын
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
@snipermonkey427
@snipermonkey427 2 жыл бұрын
YES
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
YES
@snipermonkey427
@snipermonkey427 2 жыл бұрын
@@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.
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
@@snipermonkey427 Definitely thinking about that, cool idea :D
@Zigglot
@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
@davegamedevelopment Жыл бұрын
Thanks so much, glad you like it!
@WilliamAlex
@WilliamAlex 2 жыл бұрын
your voice is changed! do you practice? Dave?
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Thanks, it just changed naturally I think. Also my English got a bit better (At least I hope so) :D
@Kevinaya
@Kevinaya 2 жыл бұрын
What was the reason you didn't upload for a whole year?
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
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
@Kevinaya
@Kevinaya 2 жыл бұрын
@@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 🤔
@nuggetman1023
@nuggetman1023 2 жыл бұрын
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.
@KrangAnimations
@KrangAnimations 2 жыл бұрын
POV: brackeys is gone
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Haha :D
@KrangAnimations
@KrangAnimations 2 жыл бұрын
@@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 😂👍
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
@@KrangAnimations Thanks a lot!
@miguelclemente4979
@miguelclemente4979 2 жыл бұрын
I made my projectile into a cube and whenever it gets parented to the wall/ground, it skews. Any way to fix this?
@twist474
@twist474 2 жыл бұрын
how do i delete the knife after some time
@retrospect8403
@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
@csr3846
@csr3846 2 жыл бұрын
Great videos! I'm unable to join your discord server though. it says, "Cannot accept invite".
@Gurem
@Gurem 7 ай бұрын
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.
@thunderhawk4592
@thunderhawk4592 2 жыл бұрын
would this work in third person
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
Yes, you just need to change the camera script
@umwhatt
@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
@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
@forrestarnold1402
@forrestarnold1402 2 жыл бұрын
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
@forrestarnold1402
@forrestarnold1402 2 жыл бұрын
i think it may have to do with my player's force being affected by the throw object
@awiseauthor3456
@awiseauthor3456 Жыл бұрын
move the "attackPoint" game object slightly forward, that should keep the object from hitting your player
@retrospect8403
@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
@RossTubes
@RossTubes 2 жыл бұрын
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?
@nathanr8515
@nathanr8515 2 жыл бұрын
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
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
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.
@NotTolik708
@NotTolik708 2 жыл бұрын
are you make collider for knife?
@CabinetManHeeHee
@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
@GeForce_IV Жыл бұрын
the projectile goes towards the player
@pietrastak9564
@pietrastak9564 11 ай бұрын
you got a fix for that?
@GeForce_IV
@GeForce_IV 11 ай бұрын
@@pietrastak9564 nah i just gave up and used another throwing systen
@amirmollaei5681
@amirmollaei5681 2 жыл бұрын
How do I download the grenade version?
@harharrr9810
@harharrr9810 2 жыл бұрын
does it work for third person character too??
@magic4671
@magic4671 2 жыл бұрын
My unity just crashes when i try to add the throw script to my player. Any idea how to fix this?
@davegamedevelopment
@davegamedevelopment 2 жыл бұрын
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
@magic4671
@magic4671 2 жыл бұрын
@@davegamedevelopment I messed up the code, Its fixed now thanks.
@SD-Gamer
@SD-Gamer Жыл бұрын
your voice like brackeys. brackeys come with real account !
@Witcherhere112
@Witcherhere112 Жыл бұрын
you sound like brackeys
@vahidhussain8549
@vahidhussain8549 2 жыл бұрын
I cant seem to shoot the arrows properly at the pointed end. It is throwing arrows horizontally.
@jaredmarrero5251
@jaredmarrero5251 2 жыл бұрын
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.
@snipermonkey427
@snipermonkey427 2 жыл бұрын
Yoooooooooooo
@genericbinary558
@genericbinary558 2 жыл бұрын
in 4:24 I plugged out my earphones and plugged in again. 🙂
@spncrszn
@spncrszn 2 жыл бұрын
I cant seem to get it to work the damage doesnt work and the knifes thrown dont stick to the targets
@olivermasiala2280
@olivermasiala2280 2 жыл бұрын
I’m having a bug I can’t throw my knife correctly because it’s only come on the vertical
@jaredmarrero5251
@jaredmarrero5251 2 жыл бұрын
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
@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?
@bnkm07
@bnkm07 2 жыл бұрын
i want to do this in godot but there is no tutorial
@logmac2735
@logmac2735 2 жыл бұрын
Knives are facing in the other direction while I throw.
@ziot7992
@ziot7992 2 жыл бұрын
same, did you find a solution?
@dekenfnombre9143
@dekenfnombre9143 2 жыл бұрын
sound like Brackey
@zachhoffman5142
@zachhoffman5142 2 жыл бұрын
Got lost,didn’t work,and gave up
@shinshogamer51
@shinshogamer51 Жыл бұрын
it sucks
@EMB3D
@EMB3D 2 ай бұрын
how come that the throwables don't collide with the player capsule?
ADVANCED SLIDING IN 9 MINUTES - Unity Tutorial
9:23
Dave / GameDevelopment
Рет қаралды 105 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
УДИВИЛ ВСЕХ СВОИМ УХОДОМ!😳 #shorts
00:49
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 43 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 33 МЛН
300W USB ADAPTER TESTED AND MEASURED, KILLER DEAL!
9:52
AllThingsOnePlace
Рет қаралды 2,9 М.
How to Make Grappling Gun in Unity (Tutorial)
10:23
DanisTutorials
Рет қаралды 869 М.
Full CLIMBING SYSTEM in 10 MINUTES - Unity Tutorial
10:25
Dave / GameDevelopment
Рет қаралды 64 М.
1 Year of Learning Game Development In 6 Minutes
6:01
Giedzilla
Рет қаралды 2,6 МЛН
Explosions in Unity! Let's blow some stuff up ;)
6:00
Tarodev
Рет қаралды 44 М.
I Wish I Had Known This Before I Started Unity Game Development...
11:11
Create A BREATHTAKING 3D Level In Unity (In 6 mins)
5:38
Thomas Brush
Рет қаралды 15 М.
FULL 3D ENEMY AI in 6 MINUTES! || Unity Tutorial
5:52
Dave / GameDevelopment
Рет қаралды 655 М.
How to make ALL kinds of GUNS with just ONE script! (Unity3d tutorial)
8:23
Dave / GameDevelopment
Рет қаралды 314 М.
УДИВИЛ ВСЕХ СВОИМ УХОДОМ!😳 #shorts
00:49