Jump to content
  • Advertisement

Mouhammad

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Mouhammad

  • Rank
    Newbie

Personal Information

  • Interests
    Programming
    QA
  1. Mouhammad

    I need help with unity... :(

    okay ill give it a try now and tell you how it works. as i thought it worked, i just had to use GameManager.Instance also in update instead of gm ,, , again thank you very much.
  2. Mouhammad

    I need help with unity... :(

    no i dont think so, i dont know right now i jumped out of my seat, again thank you i ran, ive been trying for more than 7 hours and i am pretty sure i reset the buttons many times, i dont know why it worked this time, but i am not complaining, thank god it worked. and no i dont think the gamemanager was linked in the prefab, i am pretty sure i did that after, but the store itself with its variables and functions is a prefab, anyways i am gonna work on it now, you really dont know how much i appreciate you helping me, i worked on this game for over 13 hours yesterday, even though i dont know much i really do love coding so thank you very much.
  3. Mouhammad

    I need help with unity... :(

    oh, maybe its because i have 2 stores, my store is a prefab, does that have anything to do with it, because the parts you highlighted i have them the same except the object i have has a different name. nvm i love you. it worked, it worked!!!!!!!!!!!!!!!!!!!! it worked after all that time. thank you, i dont know, the buttons were linked and they did have the store and the function as buy store, but i tried linking them again and through some magic it worked, THANK YOU VERY MUCH!!!
  4. Mouhammad

    I need help with unity... :(

    i did, i dragged the game object in the inspector. maybe there is something else, i just checked if i did again and yes i did. the weird thing is that i can use the variables in the start and update methods but not down in the buy store method, maybe this information can help. an example of that is i did the gm.addToBalance in the update method and it worked fine.
  5. Mouhammad

    I need help with unity... :(

    thank you very much, you are very kind , here are the scripts , and when i click on the buy button that calls the buystore() function i get this message: NullReferenceException: Object reference not set to an instance of an object Store.buyStore () (at Assets/Scripts/Store.cs:58) UnityEngine.Events.InvokableCall.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:166) UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:58) UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:36) UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:45) UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:50) UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:261) UnityEngine.EventSystems.EventSystem:Update() GameManager.cs Store.cs
  6. Hello, i know this is the most random thing, but i need help, i am trying to make an idle game myself and publish it, but i am learning code by myself, and i am really lost, i got stuck with a null reference exception error when i was refering to variables and functions from another script and i have been stuck for hours the references work in start and update methods but not in the method i am trying to make for my buy button, i tried alot and alot, i think i spent over 7 hours trying to figure it out and whenever i asked anyone on any forrum who could help they refused and one said and i quote '' this is the simplest error you may as well leave game development'' and i really dont want to i am working against my circumstances and studying against what my parents want me to study( i am 17) i thought maybe you could relate and help, if you can help me please message me and ill send the code so you can maybe take a look at it, thank you.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!