Hey guys, I hope you are doing well.
So I am creating a VR with XR game in which I have a list of items as Scriptable Objects. Now I want to put one item in my hand when I press a button but I run into problems because my function is not doing the right thing. This is how it looks like:
public void PutItemInHand()
{
for (int i = 0; i < inventoryItems.Count; i++)
{
if (inventoryItems*.name == "Sword")*
{
Instantiate(inventoryItems*, handSpawn.position, handSpawn.rotation);*
}
else if (inventoryItems*.name == “Gun”)*
{
Instantiate(inventoryItems*, handSpawn.position, handSpawn.rotation);*
}
}
}
Also it says: “Cannot instantiate a ScriptableObject with a position and rotation”.
Do you guys have an idea? I would be grateful for any help.
Kind regards