1.19.1 this.remove() removes more than it supposed to

I’m using wick 1.19.1 and I have 2 scripts. One is for movement, a simple isKeyDown script, then there’s an update script for hitTest stuff. I know the hitTest thing is outdated and now it’s hits, but I’m going to refer to it as hitTest.

The issue always occurs after I test the project once. Everything works, all the movement and the ability to get hit by an enemy. But then, when I test it a second time, something has broken. Please explain what happened, because it’s getting on my nerves.

1 Like

can you send a file? we might be able to help more.

My Project1-11-2021_15-54-17.wick (4.5 KB) here

it has to do with the “this.remove()”. i changed it to “this.opacity = 0” and it worked fine. not sure what’s wrong though.

@Luxapodular, This is a definitely a bug. It is somehow removing the capability to use the Keydown event again for that object…

alr thanks

Oof, looks like somehow the project is not reverting back to its original state. In 1.19, this.remove was updated to completely remove an object from the project. For some reason, this is persisting between play/pauses. Will attempt to fix ASAP.

Edit: This also seems to effect all code tabs… Thank you for reporting.

Edit 2: We set a value that lets us know if an object has been removed during a project’s play. This value seems to remain true between play pauses. There’s a couple of hacky quick-fixes that can band-aid this problem, but I’m going to look a bit deeper to find the source of an issue. Hoping to have this done by end of the day today!

1 Like

changing the opacity is a good solution, but the object will still be there, just transparent, therefore, I recommend having the object go to and stop to an empty frame, for example:

my way of removing an object without using remove()
obj.gotoAndStop(9999);

Then the object won’t be there in general because frame 9999 is empty, so the object won’t physically exist. When you want to return the object, you can simply do something like this:

obj.gotoAndStop(1);

Then you can disable the code when the object is “removed” by running it when the objects frame isn’t 9999

if(obj.currentFrameNumber!==9999){
// Run code!
}

This is just how I would remove an object, there’s many other solutions

No Need @Hamzah_Alani! I’ve just fixed this and have pushed it up to wickeditor.com/test. Will push to live at the end of the day unless there are more issues found with this before the end of the day.

2 Likes

hey, just a question, my friend wants to export animations on mobile, but he doesn’t know how or if that’s a feature. Can you tell me if it is a feature and how you can export stuff?