Trouble Using Static & Non Static Functions

I am trying to call the following cpp function from Blueprints
.h file

UFUNCTION(BlueprintCallable)
	void TestFunction(float value);

.cpp file

void AFPCharacter::TestFunction(float value){
	SetActorLocation(FVector(0, 0, 0));
}

It shows up in blueprints, but has a required “target” input. I have no clue what to put in there. The blueprint is a different class if that matters. I know putting static in .h file will allow the blueprint to call it without a target, but then SetActorLocation() doesn’t work. I guess there’s probably two ways to go. Have it static and figure out how to call SetActorLocation() or have it Non static and figure out what to put in the target input. I don’t know which one is better or easier.

I am not sure what you want to achieve though I will try to clarify details regarding your questions as much as I can. Any class created requires its object to be created to its functions. Whether they be pointers or not. If the class inherits from actor, you would usually spawn actor of class. if it inherits from component, usually you would spawn the component and attach it to the class it is spawned in. If it inherits from UObject, you would pretty much do same as component and if it is a class that doesn’t inherit from those, you can have a variable or a dynamic pointer defined. The target node is basically the variable you use to access these functions.

Static functions can be called without creation of the class but class scope is still required. With unreal engine, another thing you can do is create function library which will be a collection of static functions which can be called everywhere.

I hope that makes some sense. Though if you can provide what your goal is I can try helping with some examples. If you want more clarification, you can write what in my explanation was not clear.

For more info, I have a blueprint SaveGame class, and a Character class written in c++. I want to get and set the characters location from within the SaveGame blueprint, for loading and saving.

Not the best way to do it but I think you can perform it in following way.

  1. Character class should have set location already. You need to create identifier to see which character you want to set. Add a tag that you store for identifier.
  2. When you load the game Save Game bp, you can get “Get All Actors With Tag” to receive the character whose location you want to set, set location
    Note: All the characters need to be spawned before you can the save game function to update locations.