Hello. I’m just beginning and I’ve been following 2 tutorials for weapon tracing for combat. Both used a solution based on attaching the weapon to the character capsule’s mesh (creating a socket inside the capsule’s mesh -
and they then drop weapon inside the socket. Makes it super easy to access in BP.
In my case, I do it trying to reference the object inside skeleton’s hand socket, the weapon in it, and here was when I first encountered a major issue, so the first question is - if the weapon is in the hand socket instead of inside the character capsule’s mesh, how do I properly access that object, and it’s location from the blueprint?
Upon initialization of game I add the weapon to R hand socket callet Weapon_R:
Well, I basically do the same thing that WORKS with the messy solution, but when I reference the sword otherwise as above, it somehow fails.
Anyways, the outcome is unbelievable. Only 1 location is traced, and I have no idea what it is, it’s clearly not the weapon socket, not even 1 of them, because when I moved BOTH sockets to the top of the weapon and done some testing, the same exact result occured… when I changed the names the same below tracing still worked (no idea what it is tracing?) Below is a SS of that occurence.
im sure exactly what your saying, but my guess is the sphere is colliding with the owner, you probably want to add both the owner and the sword to actorstoignore array
I tried adding character self reference to array and linked it and it still results in same thing. I’ll try some more with collisions soon, thanks.
There also seems to be a small breakthrough / hint as to what is being traced on last screenshot. So, if I pass the character skeletal mesh to the tracing it traces also a single point and this is the root (beginning?) of the character mesh, so i’s basically a small dot on the ground, between legs of mannequin.
Therefore, I’m guessing on last screenshot it gets the weapon object but doesn’t locate the sockets, so it traces beginning of the weapon skeletal mesh?
If I understand correctly, the object I’m getting is weapon’s blueprint, which uses skeletal mesh and inside SM are the sockets in correct positions & names.
i notice you’ve replicated it now, if you’re spawning on begin play it’ll be called on client and server, this could explain why its sword100 and not 10. my guess is your colliding with the duplicate. try a switch has auth before the spawning