Announcement

Collapse
No announcement yet.

How to reference object from level blueprint

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

    How to reference object from level blueprint

    I have a cube
    I want to move it, I set a w key pressed event that changes the x position of the object. But I can't get to reference it.
    My cube is called kyubi
    There is no reference to it in the level blueprint at all ever never and I'm getting upset
    Do you know how can I reference kyubi from level blueprint?
    It should be possible but even if I uncheck the sensible context, there is no reference to it

    #2
    No reference inside the level BP? Have you tried dragging the actor into the level BP from the world outliner?

    Comment


      #3
      Are you sure the object is selected? Select the object in the world, then go to the level BP. If the object is not selected then the reference won't appear for sure.
      Or just do what DeevoTe said.
      "I have harnessed the shadows that stride from world to world to sow death and madness."

      Comment


        #4
        That is why you avoid using level blueprit. Make cube into blueprint, put that code inside cube. Make event in cube that does what you need. Then from player controller find all cube actors and trigger event.

        Or even better. Make event in GameMode blueprint that triggers your event. Then create event dispatcher in GameMode. On begin play each cube blueprint looks for GameMode, hooks to that dispatcher. And executes event when triggered.

        When you have above working, and you understand how it all works. You make Blueprintable component, move all code from cube blueprint into that component, add some boiler plate code that lets component to move parent cube actor.

        Then you have quite versalite system, you add blueprintable component to any actor and that component will watch for event and do stuff to parent (ie to actor it was placed on).

        Comment

        Working...
        X