changing a public variable of a prefab with a script.
i got a method that instantiates a prefab and then changes public variables in another script that is attached to the prefab, but when i use gameobejctreference.GetComponent<itemmanager>();
i get error: The type or namespace name 'Itemmanager' could not be found (are you missing a using directive or an assembly reference?)
edit: i did some testing, and i am pretty sure i am referencing the spawned prefab incorrectly. how do i instantiate a prefab and be able to change it's components?
Can you post the code and related classes? Have you checked your spelling? The error indicates, that the class 'Itemmanager' doesn't exist, which may be because you've misspelled it or because it's in a different assembly like within an editor folder.
Your answer
Follow this Question
Related Questions
My GetComponent is not working. 1 Answer
UnassignedReferenceException (Didn't find a solution) 1 Answer
Coding Errors 1 Answer
Help! Values from previous Serialized List<> shows up again after a while using Coroutine 0 Answers
Unity VR WebSocket Connection to ThingsBoard Error 'Failed to parse websocket command!' 1 Answer