ju_siolive
ju_siolive
CC#
Created by ju_siolive on 2/25/2023 in #help
❔ Help with a unity Inventory
oh it worked thanks guys
16 replies
CC#
Created by ju_siolive on 2/25/2023 in #help
❔ Help with a unity Inventory
Sorry for the bothering guys, it didnt work, im probly doing it wrong but thanks anyway for the help
16 replies
CC#
Created by ju_siolive on 2/25/2023 in #help
❔ Help with a unity Inventory
im using vscode but its not showing me the error
16 replies
CC#
Created by ju_siolive on 2/25/2023 in #help
❔ Help with a unity Inventory
i sware im trynna to understand, is Lenght wrong ? how do i write that then
16 replies
CC#
Created by ju_siolive on 2/25/2023 in #help
❔ Help with a unity Inventory
Sorry i dont get it
16 replies
CC#
Created by ju_siolive on 2/25/2023 in #help
❔ Help with a unity Inventory
Assets\Inventory\InventoryController.cs(29,46): error CS1061: 'Objects[]' does not contain a definition for 'Lenght' and no accessible extension method 'Lenght' accepting a first argument of type 'Objects[]' could be found (are you missing a using directive or an assembly reference?)
16 replies
CC#
Created by ju_siolive on 2/25/2023 in #help
❔ Help with a unity Inventory
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class InventoryController : MonoBehaviour { public Objects[] slots; public Image[] slotImage; public int[] slotAmount; void Start() {
} void Update() { RaycastHit hit; Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width/ 2, Screen.height / 2)); if(Physics.Raycast(ray, out hit, 5f)) { if(hit.collider.tag == "Object") { if(Input.GetKeyDown(KeyCode.E)) { for(int i = 0; i < slots.Lenght; i++) { if (slots[i] == null || slots[i].name == hit.transform.GetComponent<ObjectType>().objectType.name) { slots[i] = hit.transform.GetComponent<ObjectType>().objectType; slotAmount[i]++; slotImage[i].sprite = slots[i].itemSprite; Destroy(hit.transform.gameObject); break; } } } } } } }
16 replies