|
Post by tharindu on Jul 30, 2017 23:09:24 GMT
Better yet since you know where the vInventory object lies, use the tpc to get it.
var itemManager = vThirdPersonController.instance.GetComponent<vItemManager>();
var inventory = itemManager.inventory;
|
|
|
Post by Aaron2348 on Jul 31, 2017 2:14:54 GMT
tl;dr As the error says, vInventory doesn't have an "instance" variable. Just create a reference to the inventory: public vInventory Inventory; then assign it in the inspector...or via code: void Start () { Inventory = FindObjectOfType<vInventory> (); if (Inventory == null) Debug.LogError ("No inventory found in scene :("); } can I use this example or do i have to do it my self, I've been apart of Unity for about a year in a half, I'm familiar with most of it but coding is kinda were get a lot go bad luck, what line would i even start this on? or does that not even matter
|
|
|
Post by Aaron2348 on Jul 31, 2017 2:19:15 GMT
Better yet since you know where the vInventory object lies, use the tpc to get it. var itemManager = vThirdPersonController.instance.GetComponent<vItemManager>(); var inventory = itemManager.inventory; Thanks so much for all the help, what line of the script should i write this on, should it be were the item manager variable is? how to go about this, I'm sorry I'm not super skilled in coding yet.
|
|
|
Post by shadex on Jul 31, 2017 6:14:14 GMT
Better yet since you know where the vInventory object lies, use the tpc to get it. var itemManager = vThirdPersonController.instance.GetComponent<vItemManager>(); var inventory = itemManager.inventory; Thanks so much for all the help, what line of the script should i write this on, should it be were the item manager variable is? how to go about this, I'm sorry I'm not super skilled in coding yet. Without seeing the rest of the code, i am pretty sure anywhere in the Start(). Best place is most likely above Inventory = FindObjectOfType<vInventory> (); This is what those lines say in english: itemManager is a copy of the vItemManager function, on the componenet vThirdPersonController or atleast that is how you read the first line). inventory is a copy of the inventory from itemManager.
|
|
|
Post by tharindu on Jul 31, 2017 7:52:21 GMT
Thanks so much for all the help, what line of the script should i write this on, should it be were the item manager variable is? how to go about this, I'm sorry I'm not super skilled in coding yet. Without seeing the rest of the code, i am pretty sure anywhere in the Start(). Best place is most likely above Inventory = FindObjectOfType<vInventory> (); This is what those lines say in english: itemManager is a copy of the vItemManager function, on the componenet vThirdPersonController or atleast that is how you read the first line). inventory is a copy of the inventory from itemManager. Usually the impact of FindObjectOfType<vInventory> is a bit taxing on the performance. Which is why I posted about trying to access through the third person controller's instance's item manager component . It's much much faster than doing a FindObjectOfType. FindObjectOfType can however be useful when you're using a script that traverses across scenes.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 31, 2017 11:38:20 GMT
Aaron2348 were you able to get it working? Thanks! NuclearRasberry
|
|
|
Post by Aaron2348 on Aug 1, 2017 19:02:05 GMT
Aaron2348 were you able to get it working? Thanks! NuclearRasberry I'm just getting back to dev today, haven't had much free time, if i can get it working i will let everyone know who helped out. Peace
|
|
|
Post by Aaron2348 on Aug 2, 2017 2:49:00 GMT
Aaron2348 were you able to get it working? Thanks! NuclearRasberry sadly i have tried but have not got it to work it keeps saying this image sharing sitesi dont were to paste our write the code i was given?
|
|
|
Post by tharindu on Aug 2, 2017 4:04:43 GMT
I don't think you're writing it correctly. When you're accessing through third person controller's item manager the public variable name was inventory. Not vInventory and I don't think vInventory had an instance variable :S
|
|
|
Post by Aaron2348 on Aug 2, 2017 6:00:16 GMT
I don't think you're writing it correctly. When you're accessing through third person controller's item manager the public variable name was inventory. Not vInventory and I don't think vInventory had an instance variable :S haha well i haven't wrote anything yet i don't know were to start, but when i import the package then go to Invector folder theres only this vInventory script no "Inventory script", Inventory = FindObjectOfType<vInventory> (); I see this no where I checked the item manager script too were is it? has anyone else had to write code to get this add on to work? thought it was suppose to be quick and easy, not slow and painful :(
|
|
|
Post by winseral on Jan 2, 2018 22:01:12 GMT
"Hi,
Thanks so much for this plugin, it will come in handy for my new Mobile game, a quick question, if you want to trigger an achievement when you buy from the shop? ie, buy a new skill point, update the skill total for this skill by one in the achievement, but what would be the easiest way? I did try to hack together by on Storebutton purchase, update the Achievementinfo.Total++ and update text but this didn't work.
I guess I could write a separate The Achievement point earned method, which takes the parameter Achievementinfo? thanks"
Answered my own question - Disregard, the easiest way to fix this is to add Earn Achievement script to the Player, and when the players skill changes add Achievement point earned method.
|
|
|
Post by newbie on Jun 1, 2018 15:18:39 GMT
i encounter 44 error all script in this package why? i'm using latest Invector but all script error with "Namespace"
|
|
tholib
New vMember
Tess
Posts: 5
|
Post by tholib on Mar 18, 2020 6:53:19 GMT
Hey, does this still work in the latest version?
|
|
tholib
New vMember
Tess
Posts: 5
|
Post by tholib on Mar 18, 2020 7:11:18 GMT
InventoryWindow not found, how to fix, Please?
public delegate List<vItem> GetItemsDelegate(); public GetItemsDelegate GetItemsHandler; public InventoryWindow firstWindow; [Range(0, 1)] public float timeScaleWhileIsOpen = 0; public bool dontDestroyOnLoad = true; public List<ChangeEquipmentControl> changeEquipmentControllers; [HideInInspector] public List<InventoryWindow> windows = new List<InventoryWindow>(); [HideInInspector] public InventoryWindow currentWindow;
|
|
|
Post by Chronicman on Mar 18, 2020 13:46:14 GMT
I’ll have a little look at this Addon tonight see if I can bring it back to life for you if I can still get the source code. I honestly don’t even remember writing this lol
|
|