Anyway to convert/access a blueprint to a component in UE 4.26?

Is there any way available to access a blueprint in another blueprint via the add component? For eg: like a camera or sphere

camera components or sphere components are not blueprint actors per se.

You can create an actor blueprint, add inside a camera, sphere, functions, etc and use that actor as a child actor component inside other blueprint actors and access it.

Hope it helps

Best,
Daniel

1 Like

In my case, i have a camera setup as a blueprint and i want to use it in another blueprint(car). So i can use camera blueprint as a child blueprint actor of car blueprint. So i ahve around 4 car blueprints(distint ones). Is it possible that the camera blueprint can be used as a child blueprint actor for each car blueprint ?

yes it is.

on the Car actor add an Child Actor Component…on the properties select the camera blueprint.

To access inside camera blueprint functions and variables inside the cars blueprint just do:

CameraBP—>get Child Actor —> castTo (your cameraBP class) —>

Thanks…that will be helpful…and perphaps a question linked to it…if i have to use a blueprint two times in the world with slight modifications, what would be the best approach ? (like two camera blueprint but different angles of view or color or someother parameter) Is changing the parameter using variables is one option ? anyother ?

You can turn on the parameters you want to be able to modify in the editor by enabling the eye icon in the blueprint.

That allows you to modify it’s default value of each blueprint actor when is in the scene editor (properties/defaults)

So let me explain my situation in a more elaborative way…

I have a blueprint (BP A), which is basically plotting a shape.
I have another blueprint (BP B), which have two cameras.

Now i drag and dropped two BP A into the world. What i am trying to do is that for first BP A i need to spawn at camera 1 and second BP A should be on camera 2.

i created an instance of camera blueprint inside BP B, but how can i access camera 1 loc for first BP B and 2nd camera loc for 2nd BP B Ăź

So we have Two blueprints. A and B like this:

image

Blueprint A has a cube just for visualization like this:

Blueprint B has a cylinder for visualization and two cameras

There are multiple way to access Blueprints B from A but this is a handy one:

On blueprint A create a variable of type BLUEPRINT B and expose by turning the eye ON:

image

turn the eye ON

image

Now if you drop blueprint A into the Scene, then you will see Blueprint variable exposed like this:

now you can drop a Blueprint B in the scene and in blueprint A defaults just click the picker and select blueprint B in the scene.

You can access to it because now is stored in a Blueprint A variable:

Hope it helps

Just a small clash of ideas…i will explain…

I have a blueprint A (here a cylinder)

Now I create another blueprint B with two cameras…

Now i already created blueprint reference inside A to access B. Now I placed the blueprint A (cylinder) two times in the world.

So what i need is that i need to get location of camera 1 for my first blueprint A and 2nd camera location for the secondly added blueprint A. Now my issue is that both the blueprint A spawn at same location…how can i get two diferent position for two of them ?

is the conditonal statement works since i can acess only one camera at a time for a blueprint. or is there any way to create a drop down menu to select which camera to select for each occurance of the blueprint (like we are making variables public so that we can change for same blueprint in the world)

add a boolean to determine the camera to be used like this:

image

image

I mean it appears to me you need to check some tutorials about how to use blueprints. this is stuff you can easily figure out yourself if you have the base knowledge

ok