How to give blueprints something similar to an ID and use it later on in different blueprint?

Hello. In my project i think of creating bunch of bluprints for furnitures with physics activated. When buyed i want to spawn them as box. Later on when player opens the box, furniture will spawn and box will be destroyed. For that i need to tell box an id for which actor to be spawn. How can i do that? I’m thinking of using that id in in-game market too. And since player need to grab and carry this furnitures i need to make them as physics object. I’m new to everything so if someone tell me what to do and how to do that in a simple way it would be awesome. Thanks.

Hey Mehmet, it’s just like the code I gave you yesterday, except instead of an array of meshes, you have one mesh

You can set it in the viewport, or set it when the person buys the piece of furniture:

The ID is the static mesh variable.

Maybe -

Create an Actor Blueprint for each kind of item, and in each Blueprint…

  1. Add Component - Static Mesh [your box]. Under Details - set Visible to True
  2. Add Component - Static Mesh [your furniture] Under Details - set Visible to False
  3. Use the Event Graph to change these settings when ready. Use this function–
    Set Visibility | Unreal Engine Documentation

340276-visible.png

If you need an ID, there are built-in functions like these–

How to get actor ID Name in c++ - Blueprint - Unreal Engine Forums

If you’re new and need a walk-thru, then check out Unreal Learning, here–

Epic Developer Community Learning | Tutorials, Courses, Demos & More – Epic Developer Community

Sign-in and check the Content Library for beginner friendly stuff, like maybe search for “GameDev.tv” courses and do the “Unreal Engine Blueprint Game Developer Online Course” - it costs money elsewhere, but it’s free via Unreal Learning. Great general course, and they have a good community if you’re stuck.

If you haven’t yet, google “How to create an inventory system in Unreal Blueprints”- saw a lot of hits for that, or something similar that could help.

Good luck.

Thank you for the answer. I will look into them in details. I didn’t google “How to create an inventory system in Unreal Blueprints” since i thougt i’m not using inventory system. But looks like there is some things i can use in that system.

Thanks for the answer again. I will try it. But there some things i did’t get.

In here first, timeline_0 got 0-1 what is it doing? How can i put that here? Second, there is things like Scene, Scene1, Scene2. What are they referring?

Inside the timeline, there’s just a curve going from 0 - 1. It’s much easier to do this and then use a lerp to go between the values we want. Here, that’s 0 ( degrees ) and 120, to open the lid flaps.

Because I made the lid ( and the rest of the box ) out of cubes, the pivot point is in the middle of the mesh, which is no good if we want to rotate it on the edge, like a flap or door.

So you have to put in an extra scene component as a hinge and rotate that.

Notice how the lid component is attached to the scene component, so when we rotate the scene, the lid rotates:

340307-screenshot-4.png

A scene component doesn’t do anything, you’ll notice that when you put one in, but it just helps us to make a kind of hinge for the flap.

Thank you for the explanation. I will try it now.