#well my problem is that this code
1 messages · Page 1 of 1 (latest)
Try putting a `Debug.Log("Path :" + LevelManager.main.path[pathIndex]); in start and see if the path is not null
How do you know it's not working?
like this?
what is the filename and line number for the error you are showing?
that's the most important thing to start with
my guess is that code is simply running before this code
LevelManager.main has not been assigned yet
Ok, so you're missing a ref
and you still diodn't show where the UnassignedReferenceException is happening
you showed this already. Show code
Where is main assigned ?
!code
📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.
show the levelmanager code and also:
you still didn't show where the UnassignedReferenceException is happening
right they need to expand this error
and see which file/line it's happening in
what do you mean by that? i have the enemy movement script only on one thing
and its the target thats supposed to get a value
I mean what I said click on the error
and find the file/line where it's happening
you have at least two more scripts to show us:
- LevelManager
- Whatever script has the original error you are trying to solve in it
no
this is what comes up when i click it
I want to see code
click it
and look at the bottom of the console
it will show the FULL error message
which will have the filename/line number
this?
Or double click the error so that it shows it in VS
yes
Ok good now show us the LevelManager script
ok see you misspelled Awake
capital A
see how it's even warning you about it?
so that's not going to run at all
hence your issue
well the warning was that main was null 😆
That's why the person told you to do it in the first place