Calling a blueprint variable with dynamic name

Hello everyone,

I have a blueprint that contains the following SplineComponents:
SplineComponent1, SplineComponent2, … ,SplineComponent19, SplineComponent20

Is it possible from a function to call these variables dynamically with a String ?

In this case :

MyString : “SplineComponent” + X
X being an integer >=1 and <=20

Make a string | spline component map. But since you’re using an int, it could be easier to put the splines in an array and get one at index.


Is it possible from a function to call these variables dynamically with a String ?

I bet a better question here is why? You may have your reason but there may be a better way of achieving the end goal than associating a component with a string - which is somewhat awkward at best.

Yeah i agree, sorry for this stupid question. I simply solved this by creating a SplineComponents references array inside my blueprint.

Note to admins and modérators :

Feel free to delete this stupid and useless question. Thanks

1 Like