Are you sure your pointer is really pointing to an actor? How have you set the pointer to point to the actor? If this script is being used on a Blueprint class, you probably aren’t able to point to an actor unless it’s being used inside a scene and the pointer is being altered inside the scene.
If you’re trying to set the pointer using BP nodes, you should set it to BlueprintReadWrite
.
If you’re straightly using the class, then I’m guessing that the class is inheriting from AActor as you said it’s an actor, remember to assign the actor through engine’s internal scene combo-box.
If it’s something else, maybe share the error as well and we’ll find it out but I’m mostly sure that your pointer is nullptr
.