I have an actor component created in C++, and this component has two float variables named rotationSpeed and moveSpeed.
After i add this component to an actor, i would like to change these variables in the actor details panel, but it do not appear here.
And, if i select the component in the actor details, i get this message: “Blueprinted components must be edited in the Blueprint”.
This is the class declaration:
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class UMovementHelper : public UActorComponent
And these are the variables:
// The speed at which the actor will rotate
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement Helper")
float moveSpeed;
// The speed at which the actor will move
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement Helper")
float rotateSpeed;
Are you able to see these variables of your component if you attach this component to a blueprint of an actor? Try making an actor blueprint, opening it in the blueprint editor, add your custom component to the blueprint, and check to see if the variables will show up in the details or class default windows there, inside the blueprint editor.
Normally if a variable or component is added in a blueprint, it is considered ‘Inherited’ in the default editor. This makes it only editable in the blueprint. I believe this is why you’re seeing that message that why the variables aren’t showing up.
Yes, the variables are accessible only from the blueprint editor.
So, if i understand correctly, what you says is that only the components that are added to an C++ actor (not a blueprint one) are accessible from the actor details panel, right?
That is not true. When adding a custom component to your character and you want to expose the components variables in the editor. Simply create a uproperty in your character for the custom component. Set the UPROPERTY(EditDefaultsOnly, Category = Speeds). Make sure that your custom component also is property exposing the variables you want to edit. Then in your character initialization add this: