Code uploading problem

I made c++ class for an actor. and I thought when I drag this made class to the static mesh that i put on the world,it has to be uploaded on the static mesh. For more detail I put the heart shaped model on the world and I want to make this model keep resize the scale to make look like is beating. And I wrote a c++ code that keep resize the scale. But I don’t know how to upload this code on that heart shaped model.