Something I don't understand with an object

Discussion and feedback on Construct 2

Post » Tue Aug 25, 2015 5:26 am

Hi everyone,

I'm experiencing a very weird "bug" (though probably a mistake on my part) with an object. Here is the simplified situation :

I have a layout1 and a layout2. and I have to pass from one to another. When doing so, one object does not disappear. Always the same object, and only this one.

Concretely, this object appears on the layout 2, but is never created, spawned or something else on layout 1. Still, when switching from layout 2 to layout 1, the object stays there, at the same size and same position than it was on layout 2. I tried to create multiple instances of this object on layout 2 and they all appear on layout 1.

Even more surprising, if I destroy this object at the start of layout 1 (which was my only solution), it is also destroyed on layout 2 !

I already had the same problem with the same object when going from layout 0 to layout 1.


EDIT : I foud a solution to my problem : I destroy Object 1 at the start of Layout 1, and destroy it also at the start of layout 2, then recreates a new object just afterwards. But this sounds like a workaround. Does someone have an explanation of what's happening?
B
32
S
6
G
1
Posts: 352
Reputation: 2,810

Post » Tue Aug 25, 2015 5:52 am

Do you have the layer set to global on which the object resides ?
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Tue Aug 25, 2015 5:54 am

i encountered this kinda bug, when i used the condition On Destroy to switch on different layout, try avoiding the On destroy to change layouts and create objects on it, Ashley explained it here i hope that is the problem you have. if not maybe its something similar... hope it helped you

the issue above i was having a fast passe game, with a lot of predefined objects( predefined = i mean i built the layout architecture without events, drag and drop mode) in the layout, now when actor was dead, or got destroyed i was using ON destroy to move on menu layout to be able to start again, however when i was switching the layout, some items, and most of time one item specifically was sticking on all layouts, even though there is no event that says to be created.... that kinda sounds as your problem :D ... but from r206 above should be fixed i think

does the layout2 have the event sheet included, that says that the object to be destroyed as in layout 1?
B
76
S
22
G
69
Posts: 1,353
Reputation: 43,833

Post » Tue Aug 25, 2015 7:11 am

Be sure you have "Global" set to off in this object's properties.
B
32
S
7
G
4
Posts: 398
Reputation: 4,591

Post » Tue Aug 25, 2015 12:08 pm

Problem fixed! Indeed "Global" was set to yes. I've set it to No, and it fixed everything!
Thanks a lot!
B
32
S
6
G
1
Posts: 352
Reputation: 2,810


Return to Construct 2 General

Who is online

Users browsing this forum: AnimH01, Bootfit, Yahoo [Bot] and 14 guests