Announcement

Collapse
No announcement yet.

Proper way to implement a spellbar system (can I create object instead of spawning actors?)

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

    Proper way to implement a spellbar system (can I create object instead of spawning actors?)

    I have a container for spells (the spellbar) and a list of Spells.

    Atm they are both Actor and it is great cause I just spawn everything at BeginPlay and that's it.
    The problem is that Actor also takes a Position and I'm currently spawning everything at (0,0,0), what I'm worried about is that when the character is moving too far away or I use stuff like level streaming, they will eventually get disposed (or they have side-effects like preventing the level at (0,0,0) to unload with level streaming).
    Of course the real solution would be to not use Actor but just a simple Object but I'm not sure that it can be done in blueprints and I don't wanna implement distruptor.

    Any suggestion?


    basically I'm trying to convert GetDefaultObject<>() from C++ to blueprints without using spawnActor
    Last edited by MaxiHori; 08-23-2015, 06:08 PM.

    #2
    4.9 is coming next week , I think
    You will be able to construct Objects in BP
    Website [ LINK ]
    Twitter [ LINK ]
    Support ! [ LINK ]

    Comment


      #3
      Originally posted by Mhousse1247 View Post
      4.9 is coming next week , I think
      You will be able to construct Objects in BP
      hoah!

      just out of curiosity, how did other people do that before that? they use c++ or they spawn actor in a specific position?

      Comment


        #4
        Originally posted by MaxiHori View Post
        hoah!

        just out of curiosity, how did other people do that before that? they use c++ or they spawn actor in a specific position?
        Yes, either you make yourself a UObject in C++ (with which you can create your own BlueprintCallable Function to create this UObject)
        or, you create them as Actors, which is ok too. Since these Actors don't have something to draw (mesh/model) it is ok to use them (:
        Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

        My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
        (Including 100+ Pages Multiplayer Network Compendium to get you started.)

        Comment


          #5
          In my case i just attach (with Snap to target) any actors like these to my player. I also have all my Spells as Actors. But this:

          Originally posted by Mhousse1247 View Post
          4.9 is coming next week , I think
          You will be able to construct Objects in BP
          ... Is interesting

          Comment


            #6
            Yeah I would be adding them to the actual player character rather than spawning them at 0,0,0

            Comment

            Working...
            X