Hi everyone! I’ve been making a RPG game for a school project. Note that I don’t know anything about Unity and C# so I’ve been following a tutorial (you can find it here: https://youtube.com/playlist?list=PLPV2KyIb3jR4KLGCCAciWQ5qHudKtYeP7&si=WNx-UA_5qHikPEbJ). The armour equips just fine. My problem is that, when I equip the weapon, It’s being place in the spine of the character. I’ve been searching for days and I can’t find anything I will attach the script and some photos to show you what I mean.
I would review where the tutorial tells you to attach it as well as review any offset you might have on the weapon.
Unity is great this way because you can press PLAY, then PAUSE, then go digging into your scene and find the sword, find what it is attached to, move it to what it SHOULD be attached to, then reason about what code made it go to the wrong place and fix that.
Remember: tutorials have two steps only:
do them perfectly, without fail
stop and understand every single part well enough to explain it to your dog (see my avatar)
No game object disappears from the hierarchy, unless you destroy it. If you can see the game object on the screen, it is in the hierarchy, you just need to find it. Your sword is probably a child of the character (or one of its bones game objects, so it can be really deep in the hierarchy).
Tip: A simple Debug.Log("Sword equipped", swordGameObject) will highlight the game object in the hierarchy when the log entry is clicked, making it very easy to find.