Hello. In my project i want to make buyed objects (for example furniture) to spawn as box. Then player will unbox it and real object will spawn. As for my question; how can i arrange which box to spawn which object? Do i have to create different boxes and write to all of them one by one? I want to put lot of objects (furnitures) it will take a lot of unnecessary space both code and object wise. Is there any easier way? For example a function. If there is, how can i do that? I’m very new to Unreal (actually to everything about making game) so i don’t know if my question a stupid one.
You only need to write one blueprint, it’s a box, that opens and when it disappears, leaves a static mesh in it’s place.
The static mesh is configurable as a public variable.
If no one has posted anything by tomorrow, I will do you something…
Thanks for the answer. I think like that too but how will i assing different blueprint objects upon buy in the same box i can’t think any way. I will be waiting for the time come. Thank you.
There is some things i forgot to mention. In my project player can grab and move objects and of course box too. So i need to activate physics for them. I dont know if this changes anything thougt.
Ok, sorry for the delay. No physics yet, you might have to do a new question for that.
Basically, we have a box, it opens, spawns a small particle system and the new mesh and then destroys itself:
Thank you for the answer and your time. I will try this and try to make some modification. Do you know what i need to do about physics objects? Can i assign same variable to actor blueprints. Then in box write there to spawn blueprints. In buying IU, tell the code which blueprint to spawn. Something like that, i don’t know. Since this is blueprint even if i have some ideas i cant try them, because i don’t know what to use.
Since i ask wrong from the start, i will accept the answer. Maybe it will help someone else.
Thank you. I will look into it a little bit. If i can’t i will do what u said.
It chooses from an array of random meshes:
and the code is like this:
The main concepts are a timeline to open the box ‘lid’, then on chain to spawn the actor, and the other to make the fire and get rid of the box.
The box is just made from a bunch of flattened cubes:
I’m afraid I have no idea what to do with the physics. I know you can’t just set ‘enable physics’ on the meshes as it will just fall apart.
To make it spawn a specific actor is easy, instead of choosing one from an array, just set it to a particular one.