When you grab the first supply (the *target* variable), I assume that object is destroyed. If so, then once it gets destroyed the *target* will not have a reference. During the next Update(), it will check for a coin gameobject and FixedUpdate() will look at the target, which is set from the coin gameobject.
You get an error from:
- Not finding the coin gameobject
- Not having a reference for target
- Not having a transform to look at
----------
**EDIT**: It is not recommended to use GameObject.FindWithTag every frame—inside Update/FixedUpdate—because its use is very expensive.
↧