Announcement

Collapse
No announcement yet.

Child component variables not visible in instance - my solution

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Child component variables not visible in instance - my solution

    I'm not sure if this has been mentioned before, but I ran into the issue where I have a component which derives from another component. When I added variables in the child class, I could not for the life of me get them to be visible in an instance of the actor/component in the word.

    What seemed to be the problem was the categories. For example. In my Parent component I have this:

    Code:
    /*LogicComponent to Trigger*/
    UPROPERTY(EditAnywhere, Category = Output)
    FPBLogicComponentReference LogicComponentToTrigger;
    And in my Child class I originally had this:

    Code:
    /**If True, only specifc actors can trigger. */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Trigger", meta = (ExposeFunctionCategories = "Trigger", AllowPrivateAccess = "true"))
    bool bTriggerWithSpecificActors;
    The solution for me was to change the category from "Trigger" to "Output" IE:

    Code:
        /**If True, only specifc actors can trigger. */
        UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Output", meta = (ExposeFunctionCategories = "Output", AllowPrivateAccess = "true"))
        bool bTriggerWithSpecificActors;
    I'm not sure why this worked - I tried introducing the Category "Trigger" in the parent class, but it still failed to expose. Anyway, if you're having trouble - try changing the category to "Output". Hope this helps someone else!


    Last edited by AusPaco; 07-13-2018, 11:28 PM.

    #2
    Looking further into it, I managed to get the Trigger category to show up by doing this:

    Code:
    UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent), Blueprintable, ShowCategories = (Trigger))
    and this:
    Code:
        /**If True, only specifc actors can trigger. */
        UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Trigger)
        bool bTriggerWithSpecificActors;

    Comment

    Working...
    X