I have been trying to figure out how to change the “Location” of a component to the location of a socket in a sprite.
This is what I currently have in the blueprint.
I can’t seem to be able to find any note that allows to get a socket from a sprite. So how do I get the position of a specific socket in a sprite?
Next step would be to update the Location of the “Scene” component that I have in the blueprint to the current socket location. But I hope I will be able to figure that out myself. (hope)
Any ideas on this matter and or learning resources for this sort of blueprint stuff would be highly appreciated.
Thanks in advance!
You get the root component first, then you get the child component that you set that up via index number. I.E. I need location of child component #2 so I use the number 2 in the child index of get child component. Here is an image with all the nodes. You can check if you are using the correct child component with an actor to string and then print. You get Actor To String by pulling it out of the Return Value.
You can also pull a Get Socket Location from the Root Component node if that is what you need.
I got it to work, I just dont quite understand how.
This is the working Graph.
Now the Get Sprite at Time returns a reference to the source sprite of the flipbook frame each frame. But are we actually ever using this? I mean its not connected in any way to the graph?
Another thing would be how the Get Child Component works. Everything except Child Index  will return None, although I have a whole bunch of components. See the picture below for the components.
And lastly the socket is in the original sprites that the flipbook is using. So, how exactly is Get Socket Location even getting those sockets?
I mean, dont get me wrong, I am really grateful for the help since it works now. I just don’t understand why it works, and I would like to figure that out before I continue uncertain of what I am doing
Accept the answer if it works
You are correct when you say that Get Sprite at Time is not doing anything at the moment, you don’t need it anymore.
From what I understand, Root Component is [ROOT]Capsule Component. But that’s not how the engine sees it. If I print my root component, which is a capsule component, it prints out CollisionCylinder. Which is what the game calls capsule component I guess.
Now for the Child Component node, like everything else the first value is 0. So 0 = 1. So for you child component 0 would give you Arrow. Child Component 1 would give you Sprite. Child Component 2 would give you CameraBoom. But now if you wanted SideViewCameraComponent, you need to get another Child component from Childcomponent 2. So, this means that;
Root Component → Child Component 2 → Child Component 0
would result in you getting SideViewCameraComponent.
The weird thing is that I’m not sure what the Get Socket Location does. I tried plugging Get Socket Location with my component name directly to the root component but it just gives me the location of my root component even with In Socket Name filled out. But if I plug the Get Socket Location into the Child component, it gives me the component’s location regardless of the Get Socket Location In Socket Name. So basically, in our example, using Get socket Location node or Get Actor Location node plugged into our Get Child component does the exact same thing. Weird.
But anyways, at least this way you are able to get the location of your specific components