SAndreeaM
SAndreeaM

Reputation: 99

(GMS2) Spawner object doesn't spawn items

In GMS2 I have a spawner item with the following code:

This works perfectly fine, coffee beans are spawned when it doesn't detect any coffee bean nearby.

The problem is that the same code doesn't work when I duplicate this object and create a spawner for another item.

Upvotes: 0

Views: 472

Answers (2)

SAndreeaM
SAndreeaM

Reputation: 99

Ok, I needed to use instance_create_depth instead of instance_create_layer.

Upvotes: 0

YellowAfterlife
YellowAfterlife

Reputation: 3202

The most obvious problem here would be that you are using the object index as the layer index in instance_create_layer - your code only works by chance (of there being a layer with a matching ID).

Upvotes: 2

Related Questions