Can't send actor to layer

purplelava

  • Posts: 82
There are so many things in Stencyl that I just can't make work, I wonder if they're bugs.

1) I can't send an actor to a layer, it just doesn't do it. The code is in attachment. It creates the actor, but just doesn't send it to the layer, whether via ID or layer name.

2) The "Anchor to screen" block and behavior don't work if I attach them to an actor. If I tell the actor to attach itself to the screen, it just doesn't do it. It works only from an event or behavior in the scene. Is this the way it's supposed to be?

3) The blendmode preview in the editor just doesn't work to me. If the layer isn't in normal blending mode, it simply disappears. Bug?

TheIndieStation

  • *
  • Posts: 2263
1) did you check if there is a layer with that name / ID? Is it locked? Does the event fire (use a print block)? Do you have another piece of code that is overwritting it?

2) anchor an object BEFORE the camera moves (use a delay on the camera movement script that it will only start following after 0.5 seconds with a boolean). If your actor that has to be anchored is created at runtime, make use of the camera x and y to position your actor properly before anchoring it again.

3) never worked with them before. Sorry...

One big thing is the when created event itself. I noticed that some operations or functions dont always work in a scene behaviors when created event. Again, use a small delay to counter this.