I want to add one blueprint actor as a component to an another blueprint actor. I make an empty component slot on the one to which I attach and set the transform so that it will appear in the right place when I call “Set Component”. But I don’t know which component type I need to select to make this work. As far as I can tell it’s just straight up impossible.
My current idea is to get the static mesh component of my blueprint that is supposed to get attached and then attach that static mesh component to the predetermined position.
What I want to do is to put a piece of paper inside a glass chamber, do something with the paper while it is in the chamber and then take it out again after. But I don’t know if I can just attach the static mesh component of my BP that is supposed to get attached, leave it in the BP of the chamber for a while and then take it out and have the info retained by the static mesh component.
Here’s a small explanation of what I’m trying to achieve.
What you want to happen can just be done by using the AttachActorToActor node. Whenever the player interacts with the chamber while holding the paper, that can send a signal to the chamber with a reference to the paper. The chamber can then force the paper to attach to it, and set it’s location. You can then use the stored reference to the paper to further modify it however you want.
Also I would recommend making a CanInteract function in that Interact interface. So instead of checking if you are holding a paper, the chamber itself can check- the pawn itself doesn’t have to know that it needs to be holding paper to interact with a certain object. It’s also very useful for getting the paper back- if that’s what you want. This cleans up your logic a lot.
You’ll probably need to properly sever the connection to the player first- before using attach actor to actor. There is an option to weld the bodies on the node, but I’m not sure if that’s what you want.
Yes, but that essentially does the exact same thing as Attach Actor to Actor, except less practical. You can’t pass in a class to create, while you can see the actor in the outliner- you can’t change anything on it, and above all that wouldn’t be useful in this situation because the actor is already created, and needs to be able to be swapped between different actors.
Though, I didn’t know about this node. Thanks for bringing it up
I meant change anything on it through the outliner. I am not sure how you are supposed to move it, but feel free to tell me. I am always eager to learn new methods
That is true but you can get the variables of the child actor in the event construct of the parent and expose to use in the editor outliner.
like any other component
but back to the @ecksdeeeee question, maybe the best solution is have a hidden paper inside the box, that paper copy the real paper propieties and turn visible when interact, do any change u want with the fake, when the interaction ends copy the fake propieties to the real.
yep, that about sums it up. this is a virtual version of an experiment called “Thin-layer chromatography”.
What you do is to put a sheet of special paper in a chamber that is filled with liquid and let the liquid run up the paper due to capillary forces. So basically, there is a bunch of solvent at the bottom of the chamber and the paper soaks it up so that a linear front of solvent propagates up the paper upwards. I made a small explanation in powerpoint to keep it comprehensible.
or, as you originally envisioned it, have a variable in the Chamber actor (here, PaperInChamber) of the appropriate type (myPaper) reference it and then attach this custom component to the Chamber actor: