Тёмный

[#06] Weapon pickups: Equipping weapons at runtime 

TheKiwiCoder
Подписаться 18 тыс.
Просмотров 44 тыс.
50% 1

This video demonstrates how to dynamically equip weapons with weapon pickups, using the animation rigging package, game object recorder, and animation clips.
Weapon poses can be authored at runtime and saved into an animation clip using the game object recorder.
► Next Video: • [#07] Unity Animation ...
► Previous Video: • [#05] Shooting a weapo...
** Share this video **
• [#06] Weapon pickups: ...
**********************
** Subscribe **
/ @thekiwicoder
***********************
Follow Me:
► / thekiwicoder
► / thekiwicoder
► / discord
Thank you!

Кино

Опубликовано:

 

22 май 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 201   
@MattGibbard
@MattGibbard 4 года назад
You’ve become my favourite RU-vid channel. Can’t wait for more tutorials.
@Hertenclif
@Hertenclif 3 года назад
I am really glad I have found your channel. After Brackeys stopped creating new content I was afraid I won't find anything comparable but I can proceed with learning Unity thanks to you :)
@BrotherLavarius
@BrotherLavarius 2 года назад
THIS. I needed this clever explanation. Thank you. It was a bit mind blowing.
@danthonyhill9906
@danthonyhill9906 4 года назад
Man keep it up another awesome one 💯💯 showed ya channel to a few people 💪🏿💪🏿
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Cheers! Much appreciated :)
@iliasbouchallikht9311
@iliasbouchallikht9311 Месяц назад
This is a great tutorial!! Thank you, hope to see more from you!
@NoStupidItsManbearpig
@NoStupidItsManbearpig 3 года назад
Using the Gameobject recorder was a nice touch. Thanks :)
@solaris413
@solaris413 3 года назад
My favorite channel this is want RU-vid needed different content not only just making FPP, TPP controller whole day
@seyrediyo3053
@seyrediyo3053 4 года назад
I'm waiting for your videos. What you do works for me.
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Glad to hear!
@jamiljawhar4711
@jamiljawhar4711 4 года назад
man awesome. Bro keep it up.
@DaveyProYT
@DaveyProYT 24 дня назад
YOU LITERALLY MADE MY MY DREAM THANK YOU VERY MUCH BRO LY :)
@RagnarGaming2801
@RagnarGaming2801 4 года назад
cool topic man thanks
@nGAGE0nline
@nGAGE0nline 3 года назад
This is great stuff and should deserve a lot more views. Overly simplified video title though. I feel many people might skip over this video, thinking it's just another "Brackey's level beginner tutorial" (no offense Brackeys) on how to use a trigger to pick something up, based on the video-title. (just my thoughts)
@TheKiwiCoder
@TheKiwiCoder 3 года назад
Thank you! Titles can be tricky, but I mostly try to centre them around the gameplay content rather than tech behind it. Sometimes it’s a mix.
@nGAGE0nline
@nGAGE0nline 3 года назад
@@TheKiwiCoder Started watching the entire series :) There seems to be more information in your videos than the AnimationRigging documentation itself :D Keep it up ;)
@USBEN.
@USBEN. 2 года назад
Dope stuff.
@lucasbrum7715
@lucasbrum7715 4 года назад
thanks!
@abf94y
@abf94y 3 года назад
Great video! A few twinks I found: 1. For AnimatorOverrideController you need to create a new instance otherwise it will set it for the asset: animatorOverrideController = new AnimatorOverrideController(animator.runtimeAnimatorController); animator.runtimeAnimatorController = animatorOverrideController; 2. GameObjectRecorder should have the root object as the constructor parameter, otherwise the created animation will not work. (It will not find the transforms, they would be marked yellow in the editor) GameObjectRecorder recorder = new GameObjectRecorder(rootObject);
@moizs.5289
@moizs.5289 3 года назад
For people having issues when they change and move things under WeaponHolder, like the results are your guys arms and weapon are out of place. Just go into playmode then manually start shifting things again. Move RightHand_Grip, LeftHand_Grip and your weapon back into place. Copy component transforms and it should fix. I am currently 4min into video, this is my solution.
@TheKiwiCoder
@TheKiwiCoder 3 года назад
Thank you for providing tips!
@moizs.5289
@moizs.5289 3 года назад
@@TheKiwiCoder No problem, this series has been a huge help to me. I'd like to help when I can. You are the best!
@dump_dude6547
@dump_dude6547 3 года назад
@@TheKiwiCoder Your tutorial is very great, helpful and you speak is clean to but i dont understand why i have this error, can you help me? MissingReferenceException: the object of type 'TrailRenderer' has been destroyed but your are trying to access it . . .
@ashwinj9879
@ashwinj9879 3 года назад
i did that but hands are not moving along with the gun , did you have that issue? , it is like moves moves only a bit and sometimes hands dont move when i move weapon using weapon pose.
@kurtjenkins2646
@kurtjenkins2646 2 года назад
Did you have the problem of your player character spawning half way into the ground and unable to move?
@jeyjeywoolfolk1684
@jeyjeywoolfolk1684 Год назад
you help me a lot thank you
@jurgenvanoorschot8467
@jurgenvanoorschot8467 4 года назад
Nice work again! When i see the code youre working also on fine tuning the character locomation. Many extra added like bulletspeed etc. Ive done the weapon change and hand locations by changing the local position. The local position is stored in "weaponRayCast" object. But this is a much smoother way doing it.
@TheKiwiCoder
@TheKiwiCoder 4 года назад
I had the same setup to start with, but found it a bit fiddly. Animation clips are easy to reuse across weapons :)
@jurgenvanoorschot8467
@jurgenvanoorschot8467 4 года назад
@@TheKiwiCoder I agree, I refactored the code already. This works much beter! I didn't know this was possible.
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Jurgen van Oorschot Awesome! Glad it worked for you :)
@horkaichan8880
@horkaichan8880 4 года назад
Is there a way to set the left and right hand grip as a child of the weapon itself and change the source object of the two bone IK constraint through script when we change weapon? That way the hand positions can be a property of weapon and unique to each weapon type.
@godofnoobs1597
@godofnoobs1597 7 месяцев назад
Nice videos bro, keep it up please
@BORNIS
@BORNIS 2 года назад
Nice!))) Cool!))
@FoxApo
@FoxApo 3 года назад
Where did you come with these information from? This is absolutely amazing. I was struggling with such things for months and you just came with this treasure! Good job :)
@TheKiwiCoder
@TheKiwiCoder 3 года назад
No specific place really, just trial and error until it did what I wanted.
@dump_dude6547
@dump_dude6547 3 года назад
@@TheKiwiCoder Your tutorial is very great, helpful and you speak is clean to but i dont understand why i have this error, can you help me? MissingReferenceException: the object of type 'TrailRenderer' has been destroyed but your are trying to access it . . .
@akarsh9407
@akarsh9407 2 года назад
@@dump_dude6547 the error is self explanatory it means that the trail renderer u are trying to use through script has already been destroyed so u might check in your code whether u are destroying it somewhere or if u are using unity particle system in some of there assets they have decal destroyer which destroys gameobjects on which it is attached to u might need to remove it but i am not sure it can be due to ur code as well..
@dump_dude6547
@dump_dude6547 2 года назад
@@akarsh9407 oh ok, thx, anyways i just done this project for along time. But the problem is when you move character too much the gun will move aways from hand not in right positions so ok
@nastyaromanova5902
@nastyaromanova5902 4 года назад
Thanks, your tutorials are even better than Brackeys' vids, straight to the point (though I can't blame him, his channel got so huge he can't cover all the stuff...). Again, many thanks and keep making great tutorials!
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Thanks! Glad you’re enjoying them. Brackeys is a huge inspiration to me 👌
@psycodestudio
@psycodestudio 3 года назад
because brackey just make tutorial about overview of componets. and usually he never get into complex system like this is;
@yinmonk23
@yinmonk23 4 года назад
so damn good, a little advice, make your title related to unity , that's more easy to found by people.
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Thanks for the tip!
@farrukhmalik8747
@farrukhmalik8747 4 года назад
@@TheKiwiCoder HELP!! When I am Building the game, there is an error in the script (ActiveWeapon.cs).... Message-> Unable to build Player because " The type or namespace name "Animations" does not exist in the namespace "UnityEditor" (are you missing an assembly reference?)... BTW when i am playing the game it is not showing any error.
@mr_crapto
@mr_crapto 3 года назад
@@farrukhmalik8747 you should check your package and it will be ok
@FlutterNutter
@FlutterNutter 4 года назад
Hey man, in my opinion you should include Animation Rigging in the video title, as I think quite a number of people are looking for tutorials to do with the Animation Rigging package at the moment and there's not a great deal of information/resources out there. Hopefully it'll help you with views and subs also. I think just adding "using Animation Rigging" or "using Animation Rigging in Unity" to the end of the title would be good. Or perhaps "Weapon Pickups: Equipping at runtime using Animation Rigging in Unity" if you're worried about title length and would rather it be a tad shorter.
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Thanks for the suggestion man. The video is tagged with animation rigging, but maybe adding it to the title would help too. Cheers!
@andrenalbandian6719
@andrenalbandian6719 Год назад
Hey Kiwi loving this series for school project. Im having some issues with my hands following the weapon. Im doing things a bit differently using a sword rather than a gun but it is the same concept. When I move the pivot point manually my hands follow but when I run my swing animation or start running/moving the sword seems very static. Not sure what to do. Thanks
@Doronoss
@Doronoss 2 года назад
Alternative way of setting up the transform of the IK on different weapons: Create empty left/right IK reference on every weapon and put its transform in ActiveWeapon script (instead setting up animator) Let the Controller script have the active left/right IK when switch weapon set the transform of the left/right IK to the transform on the reference.
@billmolloy2264
@billmolloy2264 2 года назад
Cheers!
@vyacheslav2293
@vyacheslav2293 2 года назад
how to do this properly?
@LostSol25
@LostSol25 Год назад
Hey, when i set the target for the two bone Ik in code it doesn't update in runtime?
@viktorhyper
@viktorhyper 6 месяцев назад
@@LostSol25 you have to Build a rig with RigBuilder via code
@adeveloper7184
@adeveloper7184 4 года назад
Amazing, any inventory system? Like changing weapons on buttons clicks and only pick when necessary?
@TheKiwiCoder
@TheKiwiCoder 4 года назад
So many topics to cover :)
@adeveloper7184
@adeveloper7184 4 года назад
@@TheKiwiCoder yup so many, Advance AI... Hope you cover all, it's already the best third person shooter system tutorial I have ever seen. Can't wait to see more
@sax1476
@sax1476 Год назад
Great video. I got a problem with the recorded animations: when I need to move the WeaponPivot from the original position of the riffle -> The WeaponPivot position is fine but the hands are bended really weird (not like what I setup before the save). Seems like it calculate the position of the ref_right_hand_grip and ref_left_hand_grip first, then move the parent object WeaponPivot later. I fixed it by moving the ref_right_hand_grip and ref_left_hand_grip right under WeaponHolder (so it's not the child of WeaponPivot anymore). I'm not sure if it's the right fix.
@yousefahmed6975
@yousefahmed6975 2 года назад
Great tutorials I love them. My only comment is that you're a bit fast makes me miss what's going on sometimes
@Randommmszz
@Randommmszz 4 месяца назад
13:00 If anyone else is having a problem with the hand layer rig weight not going to 1 when you pick up an weapon, and your hands stay down. The way i fixed it was in the 3rd person controller in the inspector, in animator i made the update mode to normal.
@TheKiwiCoder
@TheKiwiCoder 3 месяца назад
Thank you, I really appreciate the comment to help anyone else running into this issue.
@cryptojanne1134
@cryptojanne1134 3 года назад
Amazing man, you are really good. 10/10 would marry. One question tho, what are you saying at the start of all your videos? _something_ this is kiwicoder. Is it something australian? :D
@Phatan_dev
@Phatan_dev 2 года назад
Coader welcome back
@muhammadakbarrafi5199
@muhammadakbarrafi5199 2 года назад
@TheKiwiCoder I am having a problem that in the animation override controller the animation clip changes I can save the animations to animations clip and I can see that in the animation clip after stop playing the game but when I play again then the animation is not playing
@raintrain
@raintrain 4 года назад
i cant save the weapon pose ? i can click on it but nothing happens ? any help ?
@bernie_san7964
@bernie_san7964 3 года назад
After making the weapon a prefab and putting it back in to scene, it equips as well as the IK, but the targets destination and tracer are removed upon putting the prefab in the weapon pivot. What am I doing wrong?
@K3IRRR
@K3IRRR 4 года назад
This channel is the bees knees of tutorials! Does anyone know how to assign the target of a two bone IK constraint through script??
@TheKiwiCoder
@TheKiwiCoder 4 года назад
It’s not recommended. The animation graph would need to be rebuilt which is costly. Can you get away with adding as a child of the target instead?
@K3IRRR
@K3IRRR 4 года назад
@@TheKiwiCoder I tried that but the even though the target is clearly in the right position and child the bones didn't move into position for some reason. thanks for the answer! that explains why i couldn't find info about it anywhere haha
@K3IRRR
@K3IRRR 4 года назад
ACTUALLY YOU'RE RIGHT! i just put the pivot point within the character with the two targets for hands as children. Now its really flexible for putting hands in different places!
@dump_dude6547
@dump_dude6547 3 года назад
@@TheKiwiCoder Your tutorial is very great, helpful and you speak is clean to but i dont understand why i have this error, can you help me? MissingReferenceException: the object of type 'TrailRenderer' has been destroyed but your are trying to access it . . .
@5252emre
@5252emre 3 года назад
since i added the equip function with the transform classes the weapon is spawning in my character and i cant move it, when i move the weapon mesh and restart the game the weapon goes back into the character. Edit : i must change weapon.transform.localRotation = from identity to Quaternion.euler(0, 90, -90) i hope that dont give error in the future
@aciem
@aciem 3 года назад
trying to follow your tutorial one by one, but it's hard because in each one you name things different, the first time I see that I should have inside the GO weapon, 2 game objects for the left and right hand, with a weight layer, weight of what? you don't have childs with constraints, and why? if you have a rig layer with 2 hands and you have right and left childs with constraints.
@billmolloy2264
@billmolloy2264 2 года назад
Unity is a dogs dinner for sure. With any Unity series I find it best to watch through entirely once or twice before recreating.
@headhunter531
@headhunter531 8 месяцев назад
0:40 HOLY GREEN DUDE!!
@TheKiwiCoder
@TheKiwiCoder 8 месяцев назад
Green for go ✅
@dftpunk
@dftpunk 2 года назад
Do I understand correctly, that the SaveWeaponPose we create here, as well as animator override is only needed during the game development, and when all the animations are in place, we may get rid of this method to not do excessive calculations during the actual game?
@iliasbouchallikht9311
@iliasbouchallikht9311 Месяц назад
personally I find it useful to transform the handposition by script, each weapon transforms the position and rotation of the hands and with a parameter int called weaponID in the animator i use different animations, depending on which weapon you hold (e.a. rifle, pistol etc) for those who find i also useful to work this way, here is my script. modification needed to your wishes. Attach this script to your weapon prefab: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Animations.Rigging; public class RigTransform : MonoBehaviour { [System.Serializable] public class ObjectTransformData { public string objectName; //public Transform obj; public Vector3 newPosition; public Vector3 newLocalRotation; public bool hasNewValues; [HideInInspector] public Transform obj; } public List objectsToModify = new List(); public Vector3 thisPosition; public Vector3 thisRotation; private bool initialized = false; private void Update() { if (!initialized) { InitializeObjects(); initialized = true; } if (gameObject.activeSelf) { if (this.transform.localPosition != thisPosition) { this.transform.localPosition = thisPosition; } if (this.transform.localRotation != Quaternion.Euler(thisRotation)) { this.transform.localRotation = Quaternion.Euler(thisRotation); } foreach (ObjectTransformData data in objectsToModify) { if (!data.hasNewValues && data.obj != null) { if (data.obj.localPosition != data.newPosition) { data.obj.localPosition = data.newPosition; } Quaternion newRotation = Quaternion.Euler(data.newLocalRotation); if (Quaternion.Angle(data.obj.localRotation, newRotation) > 0.001f) { data.obj.localRotation = newRotation; } data.hasNewValues = true; } } } } private void InitializeObjects() { foreach (ObjectTransformData data in objectsToModify) { Transform parentTransform = transform.parent; if (parentTransform != null) { Transform objTransform = parentTransform.Find(data.objectName); if (objTransform != null) { data.obj = objTransform; } } } } }
@gohelboy
@gohelboy 3 года назад
Can we use scritable object for hand per diffrent weapons ?
@TheKiwiCoder
@TheKiwiCoder 3 года назад
Hey, yes! Scriptable objects are great for configuration
@GameCragYT
@GameCragYT 2 года назад
Any advice for newbies coming straight from the previous episode? Everything breaks after deleting the weapon holding :( Game object is "RigLayerWeaponPose" for me, based on previous episodes
@sr_ber1816
@sr_ber1816 10 месяцев назад
do you managed to fix it
@ibpositive757
@ibpositive757 3 года назад
Just wondering if anyone else has run into this problem. The "save weapon pose" function works for me, but will lock the transforms if I try editing the same item again in runtime. Currently in order to change the transforms I need to make a new animation for it and save again.
@kylebenedetti4691
@kylebenedetti4691 2 года назад
Just ignore it and move to the next tutorial. He ends up getting rid of a lot of what he sets up in this tutorial and switches to a system where you edit an animation for the poses.
@RTWrename
@RTWrename 2 года назад
after I removed the hand grips from the weapon now my character holds the gun slighty above the transforms
@chaitoni5252
@chaitoni5252 4 года назад
How about when we got 2 state (Idle and Aim, like in 1-4 tutorial), how to call animation aim or idle in runtime ?
@TheKiwiCoder
@TheKiwiCoder 4 года назад
You could easily add another state for weapon idle and setup a transition between aimed and idle
@chaitoni5252
@chaitoni5252 4 года назад
​@@TheKiwiCoder thx, i like u code, because is look so clean and easy to read. how did you learn that ?
@prioneto
@prioneto 3 года назад
The changing of the animations during runtime doesnt work
@HackDaMainframe
@HackDaMainframe 3 года назад
Same. I gotta play around with it some more. It’ll change if I move the gun within weapon pivot, but I’m unable to move weapon pivot.
@manuielv5273
@manuielv5273 3 года назад
@@HackDaMainframe if u did save the position one time in the weapon_anim u cant move the Pivot again, u need to delete the keyframes or make a new weapon_anim and assign it to the Prefeb weapon. After that u can move it again until u save a it again for the new positions
@HackDaMainframe
@HackDaMainframe 3 года назад
@@manuielv5273 thank you! I’ll try this.
@manuielv5273
@manuielv5273 3 года назад
@@HackDaMainframe he dropped this system after this episode xd
@HackDaMainframe
@HackDaMainframe 3 года назад
@@manuielv5273 oh man!!! Maybe I’ll just skip to the next one
@chiperchiper1782
@chiperchiper1782 2 года назад
I have a problem! I'm working on first person game, I have same 2 guns(prefabs) on map when player picks it up I'm changing TwoBoneIKConstraint target from script depending on gun player is holding and TwoBoneIKConstraint target changes in inspector but it wont take effect in game. help please!
@fzycold8652
@fzycold8652 24 дня назад
I feel like there is a more elegant way to implement this but still good tutorial tho
@ashwinj9879
@ashwinj9879 3 года назад
For me the character pick gun but the hands are not holding in runtime ( rig weight still zero) any idea how to fix? , work if weapon added before play manually , will try doing the next part 😅
@sreerajkc7978
@sreerajkc7978 3 года назад
Kiwi.What should i do if need holdweapon pose riglayer?
@TheKiwiCoder
@TheKiwiCoder 3 года назад
I hope to cover some of this in the next video.
@sagorhossen7047
@sagorhossen7047 4 года назад
Great, what if we can play a weapon pickup animation and we can have 1 gun on hand and 1 on back. When we switch weapon there will be switching animation. This would be great ♥️
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Thanks for the suggestion, I’ll add it to the list!
@sagorhossen7047
@sagorhossen7047 4 года назад
Glad to hear that. ♥️
@derbabonennt8876
@derbabonennt8876 3 года назад
@TheKiwiCoder Please Help, I dont know what to do or even how to properly discribe my problem. At first everthing worked fine but suddenly the whole Rig-Builder-Animation Tool breaks my project. My Character-Mesh is walking faster than the actual player-collider. I thought at first my camera were broken but the Camera is still following the "Player" Component, the Player-Character (which is a child of the "Player" object is suddenly moving out of the Player-Object. If i turn of the Rig-Builder everything works fine again...
@jcterrible952
@jcterrible952 2 года назад
May I ask when im deleting my weapon and put it to the prefab it happens to have error can you guys help me what im missing here it says the particle system was destroyed but i dont see the error
@branislavzivanovic4775
@branislavzivanovic4775 3 года назад
When i equip the pistol, the pistol position is set to the rifle position.. i'm not sure where did i screw up.. any suggestions, help?
@HackDaMainframe
@HackDaMainframe 3 года назад
Check the naming for you animation override variable
@suyogmokal9292
@suyogmokal9292 3 года назад
@@HackDaMainframe Now I got it Thanks
@prashanthpulikonda2999
@prashanthpulikonda2999 3 года назад
@@suyogmokal9292 i cant understand please help me
@prashanthpulikonda2999
@prashanthpulikonda2999 3 года назад
@@HackDaMainframe i cant understand please help me
@HackDaMainframe
@HackDaMainframe 3 года назад
@@prashanthpulikonda2999 I can’t remember exactly cuz it’s been so long. Do as I said above. Check the name of the animation override variable. And check to make sure it matches where you reference it.
@KuvZz
@KuvZz 3 года назад
"Save weapon position" works fine but how can I set the gun position? Edit: I was moving the pistol model instead of the weapon pivot... my bad hehe Also, I can't move ref_left/right_hand_grip and WeaponPivot, it only worked once... why? :( Edit: Ok, I noticed to change grips you have to delete animation and re-do it (idk if there is another solution but that works.
@castlecodersltd
@castlecodersltd 9 месяцев назад
This is a great solution. If you're trying to replace an existing recording you can't until you delete the current one because the Animator is currently using it. Thanks this saved me a lot of time ☺
@alsadeeroffice314
@alsadeeroffice314 3 года назад
Good job.... note... the invoke method as you type it didn't work with me... i use instead Invoke("SetAnimationDelayed",0.001); Just in case someone face this issue😉😉
@shroomik8510
@shroomik8510 2 года назад
Maybe I'm the one not clever enough, but if you have the same issue after previous videos with placing WeaponPivot gameobject inside of another object, this how it's should look: WeaponHolderRoot
@user-dz4ez1bb1g
@user-dz4ez1bb1g Год назад
The type or namespace name 'RaycastWeapon' could not be found (are you missing a using directive or an assembly reference?)
@dump_dude6547
@dump_dude6547 3 года назад
@TheKiwiCoder Your tutorial is very great and helpful to me but i dont understand why i have this error, can you help me? MissingReferenceException: the object of type 'TrailRenderer' has been destroyed but your are trying to access it . . .
@dump_dude6547
@dump_dude6547 3 года назад
Yah I fix it now thanks for the tutorial =)
@KuvZz
@KuvZz 3 года назад
@@dump_dude6547 How? :c
@Crekpozer
@Crekpozer 3 года назад
@@KuvZz in the TrailRender inspector is a checkbox of "auto destruct", set this to off
@bigshotstudioslive
@bigshotstudioslive 4 года назад
I am having an issue. I was able to successfully save the rifle animation clip but when I attach the pistol and go to the context menu to save the pistol it only saves the weapon pivot and not the hand IK references. I have deleted it numerous times and retried and nothing is working. any idea what is wrong exactly?
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Double check the references on the component are assigned correctly. You could also checkout my next video on ‘animating rig constraints’ which does things a little differently. Link: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mhKjwNv86cQ.html
@iamthebubb
@iamthebubb Год назад
This just doesnt work for me, ive tried multiple times but after setting up the weapon holder, everything just breaks. Then I tried to use the gameobjectrecorder in script and it is not recognised, I am using the unity.editor
@tiagomartins5487
@tiagomartins5487 3 года назад
In the part where we equip the weapon, you reset its position, but if I do that, the weapon is a little unregulated because the location of my weapon inside the "WeaponPivot" is not zero. How to fix this please?
@TheKiwiCoder
@TheKiwiCoder 3 года назад
I think you’d need to zero out that offset, or add the offset to one of the constraints
@christopherfoster6105
@christopherfoster6105 2 года назад
Amazing tutorial! I having an issue when my player is equipping his weapon. He's able to pick up the weapon but his arms are not holding the gun. He's pretty much stuck on the idle pose. Any ideas or help from anyone? Edit: I had my player on Animate Physics instead of Normal
@llsm7553
@llsm7553 2 года назад
Did you find a solution. I think I may be having the same problem as you
@MyMusic-pi6lz
@MyMusic-pi6lz Год назад
Same
@Sponge.3x3
@Sponge.3x3 3 года назад
The weight of the handIK is not changing for me when I pickup the weapon any solutions?
@user-yp1uh9lq4s
@user-yp1uh9lq4s 3 года назад
me too
@Sponge.3x3
@Sponge.3x3 3 года назад
@@user-yp1uh9lq4s Just move on to the next video he fixes the scripts
@gohelboy
@gohelboy 4 года назад
i can not move hand grips during play mode inn scene view what is problem ?
@rustyryan4473
@rustyryan4473 4 года назад
Having this same issue off and on. Cant reproduce it.
@jesusnarvaez7397
@jesusnarvaez7397 3 года назад
My problem was i had the rifle Weapon Animation on the gun, i had to assign a new one to modify it at runtime.
@snakeplisken4278
@snakeplisken4278 3 года назад
Where can We get the 'Environment Box' to follow along?
@ToluSculpts
@ToluSculpts 3 года назад
Use unity pro builder... easy to understand
@ignatiusreilly8280
@ignatiusreilly8280 3 года назад
@4:58 - when I try to adjust, the hands don't follow the weapon.
@neozoid7009
@neozoid7009 Год назад
awesome video but how can i equip a weapon from bare handed model ???
@TheKiwiCoder
@TheKiwiCoder Год назад
Play single animation
@olegrolik
@olegrolik 3 года назад
Where can I get glass material that picked at 8:50 ?
@diliupg
@diliupg 3 года назад
keep the alpha value ( the A of RGBA) low then you get transparency
@mercyplus2360
@mercyplus2360 4 месяца назад
Hello everyone, I need help, RigIK's weight is not set when Equipping weapons in the Equip() method, I checked Debug.Log() and in the console it showed that yes, the weight is 1.0, but in the inspector this weight does not change from 0 to 1, I need help, please help
@MyOnlineTV
@MyOnlineTV 4 года назад
please provide source code too like in drive WITH SCENE it will be helpful
@TheKiwiCoder
@TheKiwiCoder 4 года назад
I can’t post the assets freely which makes providing an open project to work with a bit more work.
@MyOnlineTV
@MyOnlineTV 4 года назад
@@TheKiwiCoder ohh
@maorsuper5388
@maorsuper5388 2 года назад
3:42 i have a problem. my character just stops moving. im not using your locomotion. im using one i implemented especially for my game and it uses character controller. when the multi paren constraint references the weapon holder my character stops moving. i think its a problem with the hiercy because when i change the multi parent constraint reference to the weapon pivot it works. i tried EVRYTHING nothing works. please help.
@maorsuper5388
@maorsuper5388 2 года назад
nevermind. the problam was that i needed apply root motion on in the animator
@langlang6919
@langlang6919 3 года назад
why i cant move "weapon pivot"
@alexcasillas
@alexcasillas 4 года назад
Hey, TheKiwiCoder! First of all, thanks for this amazing videos, great job! But I wanted to ask you a question regarding setting the HandIK weight to 1.0f when equipping the new weapon. Seems like "handIK.weight = 1.0f;" it's not working for me and I'm not setting "handIK.weight = 0.0f;" anywhere but in the "Update" method when there's no weapon equiped which is actually equiped right when you do the pick up. Have any idea on why this could be happening? I can solve this by changing the HandIK on the update method if the weapon is equiped but it's different for what works for you and I've watched a few times the video trying to find the difference but seems like I cannot find it haha Thanks once again!
@alexcasillas
@alexcasillas 4 года назад
Hey also wanted to point that calling the SetLayerWeight also doesn't work either for me
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Thank you! It could be the animation states writing defaults. Try changing the defaults in the scene before pressing play. Or you can try turning off ‘write defaults’ on the animator states.
@alexcasillas
@alexcasillas 4 года назад
And overriding animations also does nothing it stays always on weapon_anim_empty and don't make the override with the animation that the prefab has
@alexcasillas
@alexcasillas 4 года назад
@@TheKiwiCoder Turning off 'write defaults' on the Weapon Layer weapon_anim_empty doesn't seem to work either. It works if I set the values on the Update Method but then I cannot update pivoting possitions and save because it's constantly setting it back
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Take a look at the next tutorial on key framing rig constraints. It does things a bit differently to this one, it might help.
@TenYearsOldGamer
@TenYearsOldGamer 2 года назад
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
@daherabuoliem1625
@daherabuoliem1625 4 года назад
I'm kinda new to unity, can anyone please tell me what is RaycastWeapon. it gives an error when i write it in visual studio
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Hi Daher, this video shows how to create the RaycastWeapon script: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-onpteKMsE84.html
@oilyza
@oilyza 4 года назад
Make sure your spelling is correct, unity is case sensitive, it Might be that you need to write RayCastWeapon instead of RaycastWeapon
@diliupg
@diliupg 3 года назад
Wouldn't it be more efficient to have the guns in a list and onTriggerEnter, identify the gun by its tag and pick the appropriate gun with the same tag from the list? That way, if there is already a weapon, we just return from the function. SO No Instantiation and no destroying.
@TheKiwiCoder
@TheKiwiCoder 3 года назад
Yeah that’s totally fine too. This is just an example, change it as you need to!
@diliupg
@diliupg 3 года назад
@@TheKiwiCoder Request your expert Opinion -> wouldn't using a pool be more efficient than instantiating and destroying?
@TheKiwiCoder
@TheKiwiCoder 3 года назад
@@diliupg Yep! In this case the instantiation rate is so low it hardly matters. Pooling will help with garbage collection spikes too
@diliupg
@diliupg 3 года назад
@@TheKiwiCoder Thank you for that!
@frontendhacker
@frontendhacker Год назад
I got a bug... The bullettracer gameobject is not been self deleted
@BlazingFunk
@BlazingFunk 2 месяца назад
I have the problem that for an unknown reason the weapon is not pointing to the crossHair anymore if I delete the Multiparent Constraint.
@BlazingFunk
@BlazingFunk 2 месяца назад
Ok, found the problem, I disabled it for testing, but it seems that is a different behavior than removing.
@phanxuantruong2204
@phanxuantruong2204 3 года назад
How do I pick up the weapon if only when I press F? i tried to update input in Update function, and call it in OnTriggerEnter....
@TheKiwiCoder
@TheKiwiCoder 3 года назад
Change OnTriggerEnter to OnTriggerStay and then check for input there
@phanxuantruong2204
@phanxuantruong2204 3 года назад
@@TheKiwiCoder oh, I don't know having OnTriggerStay function. thank you so much.
@xxasafxx1
@xxasafxx1 3 года назад
@@TheKiwiCoder hey what if i want to drop the weapon when press Q ??
@TheKiwiCoder
@TheKiwiCoder 3 года назад
@@xxasafxx1 Attach the pickup prefab to the weapon, and Instantiate it when Q is pressed.
@au11dev
@au11dev 3 года назад
If you cannot Edit the WeaponPivot or hands references at runtime, try deleting the keyframes from the weaponAnimation inside the weaponPrefab(weapon_anim_Pistol or weapon_anim_Assault). I hope it helps somebody else not go through the same frustrations :)
@gorrillaconvention
@gorrillaconvention 3 года назад
Thank you so much I was going crazy!
@jeyjeywoolfolk1684
@jeyjeywoolfolk1684 Год назад
take for the help man make my own like gta
@workshopoleg5661
@workshopoleg5661 3 года назад
Who have problems with save function (nothing happens), I have this solution: 1) I've changed second paramenetr of function BindComponentsOfType to true (recursive) 2) After saving pose, my dumb ass realised, that i might to save whole project 3) In my deep misery I've decided to assign manually my animation with saved pose to my prefab. 4) My mf animations appeared! Hope this will help you
@coreygrace8937
@coreygrace8937 3 года назад
when i equip the gun the transfrom is off it goes like 2 feet above me lolol can anybody helpppp =p
@coreygrace8937
@coreygrace8937 3 года назад
Edit: i figured it out not sure why it happend but i fixed it =p
@TheKiwiCoder
@TheKiwiCoder 3 года назад
Nice!
@prioneto
@prioneto 3 года назад
@@coreygrace8937 how did you fix it?
@MyMusic-pi6lz
@MyMusic-pi6lz Год назад
Weapon equips correctly... But the position and hand ik weight are not working... Plz anyone help.... 🥲
@TheKiwiCoder
@TheKiwiCoder Год назад
Try discord
@seyrediyo3053
@seyrediyo3053 4 года назад
we need to add enemies and deal damage PLSSS :)
@TheKiwiCoder
@TheKiwiCoder 4 года назад
Yeah enemies will be fun when I get around to them..
@lucasbrum7715
@lucasbrum7715 4 года назад
3:40 my rig was completely disfigured :c
@lucasbrum7715
@lucasbrum7715 4 года назад
after i changed the references of hand, did not work.
@TheKiwiCoder
@TheKiwiCoder 4 года назад
It can be tricky to get right. Double check the transforms on the holder / pivot / left and right nodes. Worst case, just reset them and start again by positioning the pivot, then the left/right.
@huseyinyldrm4725
@huseyinyldrm4725 Год назад
animation does not change
@thepolygonpilgrimage
@thepolygonpilgrimage 5 месяцев назад
Tried to follow this and everything broke. The steps presented do not work as shown. There may have been updates overtime. Good luck getting any help from the dead discord channel
@adamcookie26
@adamcookie26 5 месяцев назад
yeah, someone posted a link to a nsfw server and it's yet to have been removed, it was posted Feb 3rd and now it's the 4th
@haithammahmoud6825
@haithammahmoud6825 4 года назад
Recoil Plz ^_^ Recoil is the backward movement of a gun when it is shoot
@pr1meKun
@pr1meKun 3 года назад
you messed up all the things
@TheKiwiCoder
@TheKiwiCoder 3 года назад
Haha like what?
@pr1meKun
@pr1meKun 3 года назад
@@TheKiwiCoder I was confused but after watching this video several times now everything is alright thank you so much kiwi
@yks7188
@yks7188 14 дней назад
Далее
I Made a Game Using Only ChatGPT
9:01
Просмотров 16 тыс.
Is it impossible to cut off so much?💀🍗
00:14
Просмотров 4,7 млн
ХЕРЕЙД БОИТСЯ МОЕЙ СОБАКИ!
37:08
На чем играют ПРО | Standoff 2
07:25
Просмотров 274 тыс.
Games Where You're NOT the Main Character
14:52
Просмотров 2 млн
Coding Adventure: Portals
16:06
Просмотров 1,3 млн
Learn to Code in  UE5 - 2 - Your First Class
14:00
Просмотров 41 тыс.
няня привела в дом чужого
0:59