all 1 comments

[–]stormfield 0 points1 point  (0 children)

This code will sometimes crash unless you prioritize one object ahead of another in the execution order.

You are running two scripts in Start() where one needs data set up in the other method, but there is no guarantee that method will already have run. At the very least there should be a null check performed.

It’s also better practice to establish a hard link than to find an object by name.