0

I tried to get a "player" assignment from "game manager" in another script. Some scripts work normally, but some scripts do not (nullreference error).

I'll tell you exactly. The 'Player Controller' script allows you to recall 'Player' from 'Game Manager'. However, in the "Arrow" script, it is impossible to take out the "Player" in "Game Manager."

In Game Manager, 'Player' is referenced through 'Inspector'. However, the 'arrow' script generates a 'null reference error'.

Why does this happen?

KwangWon
  • 1
  • 2
  • 1
    If you're seeing a NullReferenceException then it means you're trying to use a member of an object which hasn't been instantiated yet. See [What is a NullReferenceException and how do I fix it?](https://stackoverflow.com/q/4660142/16563198). We can't tell you why it's happening unless you show us your code. See also [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). – sbridewell Jul 23 '23 at 14:30

0 Answers0