Reference to a component for another component
So, I've decided to become the ue4 guru, but I've stuck at the beginning :( Keep in mind following
In a character editor I'm creating this custom movement and movement component. Here's the issue: I want to pass a reference of this movement component to my custom movement, but I can't find a way to do this.
I've been developing using Unity for some time, hence the behaviour I want to get is a SerializedField property.
Patiently waiting for a master to help soon-to-be-master :)
asked Jan 22 '15 at 04:05 PM in C++ Programming
You mean something like this?
answered Jul 04 '15 at 02:54 PM
Don't know if you've found a better way, but I do it through setting the reference manually using BP nodes.
For example, in my BeginPlay event, I manually get a reference to both components, and then use the "Set [Name of Variable]" node and pass the reference. I'd love for metadata to be able to describe where to find the component and allow direct setting in the details window, but that's a good workaround.
Edit: Oh yeah, you might also want to mark the property "VisibleAnywhere" so that you can't set it to something invalid from the Details panel.
Maybe somebody finds this useful: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/31125-reference-existing-component
Using an FComponentReference instead.
answered Jan 25 '18 at 01:38 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here