Announcement

Collapse
No announcement yet.

Convert string to object reference dynamically?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Convert string to object reference dynamically?

    Hi, is there a command to convert a string to an object reference? I have 11 lights in my blueprint ("Spotlight1" to "Spotlight11"), I'd like to perform the same set of commands on all of them on a key press.

    Can I use a For Loop to generate the component name, and then pass that as the target to instructions like 'Toggle Visibility'?

    #2
    If they are all of the same class, you can use Get Components by Class to get an array of the components, then use a ForEach Loop to do something to each of them.

    There's also Get Components by Tag if you just need a subset of them.

    Comment


      #3
      Thanks - I think I'm there now.

      Comment

      Working...
      X