Announcement

Collapse
No announcement yet.

Reroute nodes or variables? Performance costs?

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

  • Reroute nodes or variables? Performance costs?

    In theory would it be cheaper on performance to create a variable of a incoming reference and reuse it, or just drag reroute nodes of it and create a big spaghetti?


  • #2
    If I were to imagine this in terms of written code, it should look like this:

    FunctionShoot(Damage)
    {
    ReduceHealth(Damage)
    }

    FunctionShoot(Damage)
    {
    TempDamage = Damage
    ReduceHealth(TempDamage)
    }

    So temporary variable look heavier but honestly I don't think it's really relevant. And since I often end up modifying the parameter, I almost always create a temporary variable.
    [WIP - Plugin] Multiplayer Combat Editor
    A-RPG Sacred Swords
    Youtube Tutorials

    Comment


    • #3
      In BP, it is better to create readable functions and therefore, in this case it is better to create a local variable and use this, instead of keep reusing the parameter (and therefore create spaghetti code lol)

      Comment

      Working...
      X