Collision shapes of anchored actors move when moving camera [Solved]

mbergoei

  • Posts: 22
Hi everyone,

I am new to Stencyl and have been having a lot of fun making my first game. I am stuck with the following problem, hope someone can give me a hand:
1. I have 6 actors spawned when creating the scene and anchored to screen
2. Scene is 5900 pixels wide and scrolls from left to right
3. This actors have to be dragged and dropped throughout the scene as it scrolls

My problem is that as the scene scrolls the actor’s collision shapes moves along with the background so when the actor needs to be dragged and dropped the collision in the scene is not detected.

Tried to:
1. In actor events, when updating set the collision shape. However, this locks the game when building the scene
2. Created a list with the actor type’s names and using the For each Item block, sort through the list and create a new collision shape for the remaining (still anchored) actors. Tried to use For collision block with but haven’t been able to correctly refer to each actor type and the game crashes.

I am using Stencyl 4.03 and Xcode 12. Can’t get logs because when testing to device Stencyl doesn’t launch the game and I hav to manually launch it. So no logs are written during game play. And test to Flash crashes when building.

I have already gone over the forums and haven’t been able to find an answer. I apologize if I it has already been answered and I missed it.

Thanks!!!!

MB

« Last Edit: September 26, 2020, 11:03:03 am by mbergoei »

Luyren

  • *
  • Posts: 2810
Switch to an animation without collision when it is anchored, or just don't use collision boxes at all if they are not necessary.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

mbergoei

  • Posts: 22
Thank you Luyren for your quick reply! I’ll try to figure it out. Unfortunately I need those collision boxes. I will try to assign a new collision shape for the actors after each scroll.

Best,

M

mbergoei

  • Posts: 22
I found a workaround. After scrolling the screen I kill and re-spawn each actor type again, and thus the collision boxes remain attached to the actor.

M