I have really simple question. I have 8 objects with same script below. I want all of them to spawn prefab at theirs position on collision with player. All of them spawn prefab at first object position. How do I change it?
public GameObject cutingPrefab;
public bool placedCut;
void Start()
{
placedCut = false;
}
void Update()
{
if (collided && !placedCut)
{
Instantiate(cutingPrefab);
placedCut = true;
}
}
I’ve tried to do
Instantiate(cutingPrefab, transform.position)
But it gives an error.