So my question is how do i properly use an prefab because i just can’t quite figure it out, in my tests i have been getting the following:
Here is my code that is on the Button that i will use OnClick() after i fix this:
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
public class DrawDeck : MonoBehaviour
{
public Transform Card;
// Start is called before the first frame update
void Start()
{
Object prefab = AssetDatabase.LoadAssetAtPath("Assets/Card.prefab", typeof(GameObject));
GameObject clone = Instantiate(prefab, Vector3.zero, Quaternion.identity) as GameObject;
clone.transform.position = Vector3.one;
}
// Update is called once per frame
void Update()
{
}
}
When i check on the Object expanding him i see that i got everything from the Card prefab to the Card(Clone) (exactly what it should be).
However i dont know how to set a parent that i dont have anything on(in this case would be PlayerHand disregarding the Card that already is there), or even edit the CardImage, CardTitle,CardDesc etc.
When i create a new Card can i set the CardTitle in a script or in this case on this script?
How do tell unity what parent he should put the card?
And why is this Card(Clone) invisible?
Any Help would be appreciated, ty