x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Attaching weapon to socket is'nt spawning good

When I attach weapon to my character socket its spawning it in a wrong place, not like I placed it in skeleton socket. The problem just raised and I don't really know what caused it, the exact same script used to work but suddenly somthing happend. Any ideas what can caused it? btw its not the same weapon but still has a problem.alt text alt text

Product Version: UE 4.21
Tags:
sk.png (888.8 kB)
sk2.png (910.1 kB)
sk3.png (111.9 kB)
more ▼

asked Apr 21 '19 at 10:47 PM in Blueprint Scripting

avatar image

avivZx
1 1 1

avatar image DonBusso Apr 22 '19 at 10:33 AM

Hello there. I must say you got me interested so I had to give this a try and it worked like a charm for me. I'm posting a video below. Let me know if this is what you wanted. You can have the gun stay on the ground after AI dies too but I found it a bit annoying after a while.

I used to attached weapons manually before this way seems way better.

How did I do this. Well I added a new socket to my "hand_r" bone, named it Gun Then I just followed your steps. I have created a new blueprint actor and in Viewport added a Skeletal Mesh Component. In my AI character on Event Begin Play I have added a small delay and then just used the nodes you posted above.

https://www.youtube.com/watch?v=DvJY37tVhms

Edit: Forgot about Image https://imgur.com/prHarVH

Hope this will help you.

avatar image avivZx Apr 22 '19 at 11:58 AM

Hi there, thank you for your reply. I think there is orientation bug because I placed right the socket with the weapon, but when I attach it it's spawn in different rotation but same location. I read about that bug but I don't really know how to fix this. every object I place in any socket will be different rotation when spawned.

avatar image DonBusso Apr 22 '19 at 12:20 PM

Do you have an actor for your weapon? Any chance we could have a look at viewport of it.

avatar image milomilo Apr 22 '19 at 10:51 AM

Hi, In the AttachToComponent block the SocketName value is "Weap". Is that the correct socket name?

avatar image DonBusso Apr 22 '19 at 11:02 AM

The weapon is getting attached to the character so the socket name isn't a problem here. It's all about the rotation. Just play around with rotation in your gun actor`s Viewport.

avatar image avivZx Apr 22 '19 at 12:00 PM

The weapon rotation when spawned is different from socket coordinates or socket coordinates wrong when I placed it. Somthing is strange here.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

alt text

alt text

wk.png (244.7 kB)
wk2.png (548.9 kB)
wk3.png (318.8 kB)
wk4.png (294.4 kB)
more ▼

answered Apr 22 '19 at 12:36 PM

avatar image

avivZx
1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Created a new project just to be sure. I had a problem when the weapon spawned in the air but I have it all sorted out. Allow me some time so I can record a video of the whole process.

more ▼

answered Apr 22 '19 at 01:12 PM

avatar image

DonBusso
507 3 5 6

avatar image DonBusso Apr 22 '19 at 03:05 PM

Here you go, maybe it will help you out. Sorry my sound really quiet in the video, not used to record stuff. :D This is how I did it. Enjoy.

https://www.youtube.com/watch?v=LKRuCvaEFlM

avatar image avivZx Apr 22 '19 at 04:56 PM

Thank you, I've seen that my weapon rotation was actually -90 degrees so after rotating this out it works fine! thank you for your effort!

avatar image DonBusso Apr 22 '19 at 05:41 PM

Happy to help :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question