As the title says, I try to reference one script from another and I try to do it via inspector (as with components and monobehaviours in Unity).
It works with entities but I can’t get it to work with scripts and there is no attribute type for it.
So does it work and if, how?
There is only an ‘entity’ script attribute type - there is no ‘component’ type. It is different to Unity in that respect.
Ok, yes, I have seen that, so linking scripts directly is not possible?
Correct.
Ok, thanks
Once you have the entity though, you can reference the script directly from it which works well for a workaround. The Model Viewer template does this if you need to see an example.
1 Like
Yeah. I set and read script variables for scriptA with scriptB all the time. Though I should probably be triggering and listening for events instead most of the time.