Announcement

Collapse
No announcement yet.

Linetrace optimisation question

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

    Linetrace optimisation question

    Hi, I have a linetrace script attach to my player .The script itself is a litle complicated but to make a long story short, when thje player line trace hit an object it create an outline on it. The thing work and all but I have a feeling it is not optimize at all. You can see the script down here, it is not the actual script but that pretty much the logic

    My question is, is there a way to make all of it more optimize because I feel it is really not.

    Thanks


    #2
    You could store the Cast nodes outputs to a variable so you dont have to cast every tick (if your running this on tick)

    But even if not, as long as your not running this function 100s of times a frame you should be fine
    My Game Frontier Devblog HERE

    Comment


      #3
      Excellent thanks for the tips

      Comment


        #4
        Instead of doing any casting at all, you could use interfaces.

        https://docs.unrealengine.com/latest...ingInterfaces/

        This would send out an function call to any blueprint that was implementing this interface, and ignore it if it wasn't. Then each blueprint can have specific event functionality inside its own class.



        Comment

        Working...
        X