View Issue Details

IDProjectCategoryView StatusLast Update
0027963RunnerVariables (In-Built)Public2019-06-24 11:57
ReporterStewart BishopAssigned ToMike Rennie 
PriorityHighSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
Product Version2.2.1 
Target Version2.2.3Fixed in Version2.2.3 
Summary0027963: Variables: layer gets set to -1 when changing room for persistent objects
Description Persistent object's layers are stuck on "-1" upon re-entering their original rooms.

When persistent objects arrive in a new room they're layers are set to -1, which is troublesome, but to get around it you can manually set the layer in code. Although all code affecting the layer is overwritten to "-1" when they return to the room they spawned in.

I have attached a project that switches between rooms on key press and attempts to overwrite "-1".

Layer's being set and forced to -1 causes all instance_create_layer(layer) lines unusable and having to manually set the layer when each room has an identical layers is already problematic.
Steps To Reproduce1) Import project
2) Run project
3) Press space a few times
4) See that this works
5) Open the objects room start event
6) Comment out the line setting layer
7) Run the project again and see that once space is pressed the layer functions no longer work
Tagsfsd, rendering, Runner
1.4 Found In
2.x Runtime Found In2.2.1.287
2.x Runtime Verified In9.2.1.1805


has duplicate 0029410 ClosedMike Rennie General: Changing to a persistent room or restarting a persistent room changes which layer an object is on 


Stewart Bishop

2017-10-03 12:30


LayerBug.yyz (16,476 bytes)


2017-10-04 09:15

Adminstrator   ~0055894

Shouldn't this all be fixed in 2.1.1?

Mike Rennie

2019-05-02 17:17

Developer   ~0063787

The new behaviour is as follows:
- When transitioning from one room to another, we now try to put persistent objects on a layer with the same name as the one they were previously on. If we can't find one with that name then one is created. This means that the layer ID does still change from room to room, but returning to the original room will return the object to its original layer.