antithing
(antithing)
April 14, 2015, 5:31pm
1
Hey all, I am trying to create an FString variable in c++ that i can GET and SET from blueprints.
I have this:
//.h
UFUNCTION(BlueprintCallable, Category = "VPDATA")
static FString SelectionSET(FString Selection);
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VPDATA")
FString SelectedItem;
//.cpp
FString UListDataObject::SelectionSET(FString Selection)
{
SelectedItem->Selection;
}
which is wrong… Do I need a UFUNCTION for this? Or can i just somehow set a var that is Blueprint set/get-able?
Thanks!
Well im no expert but i think it should work. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “VPDATA”) should allow you to change the variable inside blueprint.
antithing
(antithing)
April 14, 2015, 7:47pm
3
That’s what i thought… But it refuses to show up!
antithing
(antithing)
April 14, 2015, 7:53pm
4
ACtually… now it is there. weird. BUT, Is it possible to make a static FString?
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “VPDATA”)
static FString SelectedItem;
…would mean that I don’t need a target in the BP graph.
antithing
(antithing)
April 14, 2015, 8:14pm
5
Aha, sorted. I was setting the Variable in a UOBJECT class. Moved to an Actor class and I can get it as a target node.
thanks for your help!