Iron, Copper resources in ue4. Mining hand and machine

Google is not all ways my friend. There’s so much info that is missing that not everything we need to learn is on google.

How can I add a resource on the ground of my landscape. That I can mine by hand or machine. Mine it by hand puts it into my inventory. Mine it by machine add it too the machines inventory.
Does anyone know how to do something like this in the easy way. For beginners.

First you could make the resource an actor, and that actor would have code/blueprint with variables to keep track of how many minerals are left.

Then you would have a system for interaction; the player clicks, and where they click gets activated. In this case you would have to add interaction code to the resource actor to allow interaction.

The machine would be another actor that the player could place with the ui, when the machine is placed it would interact with the resource and save it in a variable so it can mine the resource over time, using a tick function.

You also need inventory code for the machine and the player.

I think I have a tutorial where is shown how to mine/delete something with the player pawn.

From minute 22 she is explaining that. Maybe it helps a bit.

https://www.youtube.com/watch?v=hmxIXXoN9Yo

Thanks. No that would help. It’s a different idea as the video is not the same. More then likely you miss understood me. What I’m trying to do is how to make the resource on the landscape.
I all ready have a interaction inventory all ready setup and so on. It just I need to know how to add a resource to my game. I have been playing around with the PB actor and I know this is part of it.
I have an actor for every resource. Like 1 actor resource is iron, Then copper and so on. It’s just I’m not sure if what I’m doing is the right way. I would then add a mesh to the actor and place it
on my landscape and then when I walk up to it. I would see this “Press E to mine iron ore”] … And a machine like a mining machine would mine it for me.

I hope that helps you or so some. That can give me an idea on how to do this or even tell me if what I’m going it the right way.

Same principles as “Battle Royale Loot Spawning”.

You need to create a “Spawner” that randomly chooses the items to spawn. It then spawns them at it’s location in the world, Or with in a Bounds.

ok, I have no idea. I haven’t done any spawning yet

If you have some time I’ve posted some in depth walkthroughs on this type of setup. Just look through my post history. You can search through it as well.

Example, spawning actor Mining_Node on level start. Mining Node actor has set a few bools instanced and exposed on spawn so that you can tell the spawner what to spawn depending on current region. The random switch is to add the chance that it will not spawn. To actually mine a node you need extra code, depending on how your game is using things like weapon collisions, to check for collisions of mining pickaxe against a node hit. TO make this easier I created a new collision type in the project settings for MiningNode. Perhaps this gives you a better idea, how to start with this.

@Rev0verDrive I did just that and got 3 pages. Just nothing about what I’m talking about. I did a search on iron, copper and coal resources.

@unit23 thanks again. It does help somewhat. It’s just that do you have what I need to setup the actor for the SpawnActor mining Node. That would help.

It’s not just a single blueprint, it includes a datatable, structures, and in regards to collision is part of several other blueprints. It really depends on how you plan to integrate it into your project, the spawner above is however universal.

Anyway, here is my

the default setup.

That’s what I was thinking. It is over my head. Does anyone have a video tutorial on something like this or step by step documents. For something like this I will need to start from scratch.