Reflection Failure

Bolt can automatically call methods, fields and properties from any custom script in your project. For example, you can create a node from a custom Player class with a TakeDamage method: 

using UnityEngine;
public class Player : MonoBehaviour
{
    public void TakeDamage(int damage)
    {
        // ...
    }
}

In a flow graph, it would look like:


If you change your script and rename or remove the TakeDamage method or the Player class. For example:

using UnityEngine;
public class Player : MonoBehaviour
{
    public void InflictDamage(int damage)
    {
        // ...
    }
}

Any connections and inline values made to that node will be disconnected. In order to recover these you must reopen the script file and note what the name was changed from.

using UnityEngine;
public class Player : MonoBehaviour
{
    [RenamedFrom("TakeDamage")]
    public void InflictDamage(int damage)
    {
        // ...
    }
}

You should take special care when designing your class and member names, because renaming them at a later time may cause graphs to break.

This article was helpful for 22 people. Is this article helpful for you?

+1

Is it or will it be possible to Annotate members and only Annotated members will be accessable via Bolt?
This would let Programmers configure more precisely what Designers may do and what not...
And maybe it would be possible to give a name in the annotations so that the Node will be called the same but Programmers can rename the member in code...

This would be awesome