Problems Following Tutorial
I have make this question in discord, but they were busy I am following this >https://www.youtube.com/watch?v=1fbd-yTcMgY tutorial I did everything that it asks(see atachments) I am not able to drag and drop any item The problem is that he starts with the objects already putted, i think is there that i made the mistake I am at 5 minutes in the tutorial
Item.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Item : MonoBehaviour
{
public string itemName;
}
Slot.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Slot : MonoBehaviour
{
public Item item;
public int index;
}
CraftingManager.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CraftingManager : MonoBehaviour
{
private Item currentItem;
public Image CustomCursor;
public void OuMouseDownItem(Item item){
if(currentItem == null){
currentItem = item;
CustomCursor.gameObject.SetActive(true);
CustomCursor.sprite = currentItem.GetComponent<Image>().sprite;
}
}
}
CustomCursor.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CustomCursor : MonoBehaviour
{
void Awake()
{
transform.position = Input.mousePosition;
}
void Update()
{
transform.position = Input.mousePosition;
}
}
Comment
Your answer
Follow this Question
Related Questions
Inventory and crafting 1 Answer
Inventory Add Item error 2 Answers
I want to create a simple crafting/combining system, but I have no idea how! 0 Answers