Harvestable Plant Blueprint

Hey we are trying to make harvestable herb plants in UE4 using blueprints. Our plants have two mesh variants. One is the plant before it’s harvested and the other is the plant after it is harvested.

Basically, we want the player to walk up to the plant, press a button, and the plants mesh switches.

Can someone give us pointers as to what blueprint nodes we could utilize? Is there something like a swap mesh node? Thank you


Harvested Plant

You could do something like have plant mesh where you want it and then do a spawn of the harvested mesh. You want spawn actor from class for harvested mesh but get the location of the plant before harvest when picking it up. You need and volume or sphere around plant and then use a button press to change mesh and kill sphere around original plant.

Set static mesh (if it is a static mesh of course) Here you can specify what mesh a component should be changed to.

ye I would also go with set static mesh. on overlap you set a reference to the plant in your char. then on pressing your key he checks whether a reference is valid and if yes you check whether it is already harvested and if no you set the static mesh to the harvested plant. I wouldn’t spawn a new actor from class there is no sense for that.

I did the same with a tree and a trunk in an own Actor Bp. Created 2 instanced static mesh comp. and add / remove the instanced static mesh on custom events. In addition you should store the locations in arrays to keep access.

But also a questions on this method:
How can i get access to a unique respawn time (float) variable to set the right time on a load up?
At the moment every single instance is kinda fake loaded depending on a flag and starting at the beginning of the timeline… i want every single instance to use the time, they had stopped at. Any ideas?

Hello again. Thanks for all the great suggestions! Unfortunately we are stuck and are Blueprints knowledge is beginner at best. Here is a picture of what we have now. In its current state the meshes dont swap even though they are marked static in the blueprint.

If anyone has any suggestions that would be great.

do you have a character? because your input wont work on other blueprints by default. try to access the bp through your character. this could be done with a collision sphere. when you walk over it you get the overlapping actor reference and change his static mesh

I presume you want something along the lines of Ark’s harvest system?

Basically You put that Blueprint in an level, and then in your Pawn you make a Line Trace every time you press E, Cast the HitActor to ExampleHarvest(or whatever you name the blueprint) and if the Cast succeds, call Harvest on the casted object.