I’d like to spawn a single sprite on collision with a set position. Currently when I spawn the sprite (as a prefab), it creates multiples of itself each time I pass the spawn point. How can I set the specific location for the spawned sprite and only instantiate it one time?
public class CreateObject : MonoBehaviour
{
public Transform Spawnpoint;
public RigidBody Prefab;
void OnTriggerEnter()
{
RigidBody RigidPrefab;
RigidPrefab = Instantiate(Prefab, Spawnpoint.position, Quaterion.identity) as RigidBody;
}
}