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"

Changing Socket Location in Paper2D

Hello, 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. alt text 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!

-JJ

Product Version: Not Selected
Tags:
more ▼

asked Nov 29 '14 at 01:23 PM in Using UE4

avatar image

JJG
10 2 5 8

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

1 answer: sort voted first

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.

alt text

You can also pull a Get Socket Location from the Root Component node if that is what you need.

more ▼

answered Nov 29 '14 at 08:11 PM

avatar image

Mortusnyte
916 45 20 77

avatar image JJG Nov 29 '14 at 08:56 PM

I got it to work, I just dont quite understand how. This is the working Graph. alt text 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 [1] will return None, although I have a whole bunch of components. See the picture below for the components. alt text 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 :/

br, JJ

avatar image Mortusnyte Nov 29 '14 at 09:58 PM

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 :)

(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