pick up weapons from the ground (problem c++)
Hello guys. I'm trying to pick up weapons from the ground. First, play animation and then snap the root component of weapon to character socket. But if I snap the root component of weapon to socket, the weapon don't receives the correct location. If I snap only the weapon mesh, the weapon receives the correct location, but if I throw out the weapon and pick up again, weapon receives incorrect location. Somebody?
This code causes the weapon to receive incorrect position
and this code causes the weapon to receive the correct position, but to throw it away and then take the gun back she does not receive the correct location of the socket
asked Feb 22 '16 at 08:32 PM in C++ Programming
USceneComponent::AttachTo takes an EAttachType as an optional parameter, after the socket name. When you are calling AttachTo on your root component, if you pass EAttachLocation::SnapToTarget as that extra argument, like so:
I believe the weapon should teleport to the socket.
answered Feb 24 '16 at 10:24 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here