[SOLVED]Creating collision shapes

Max Marin

  • Posts: 138
I have 12 animations with the name of 0 - 11, why doesn't this work?

« Last Edit: February 08, 2021, 01:10:49 pm by Max Marin »
I'm human

TF101

  • *
  • Posts: 82
You count backwards

Luyren

  • *
  • Posts: 2747
"Current Loop Count" starts at 0, so your -1 is getting animation "-1". Saying "Doesn't work" isn't much help, you have to explain what is happening and what you expect to happen.
On a related note, there is probably a better way to do what you want to achieve instead of adding collision shapes during runtime.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Max Marin

  • Posts: 138
what I want to do is not have to put the collisions one by one that are all the same
I'm human

Luyren

  • *
  • Posts: 2747
https://youtu.be/TIGInUgT67A?t=318
Time stamp relevant, at 5 minutes, shows you how to minimize the work load when adding collisions.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Max Marin

  • Posts: 138
I really need this because I have like 6 actors with the 12 animations, although that speeds up a lot, it would be super easy with the other way, I also tried an animation by one and it doesn't work either
I'm human

Luyren

  • *
  • Posts: 2747
6 actors with 12 animations, you can just remove all the animations, create the template collision as the video suggests and go from there, it won't take long. Trying to do that by code is over-complicating your life and making your game perform needless operations.

There's also the possibility that collision shapes added at runtime don't persist when you switch animations. If that is the case, which your "doesn't work" comment suggests, your code approach is not appropriate in this loop format.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Max Marin

  • Posts: 138
Thank you Luyren you were right, the collisions disappear when the animation is changed but it can be done this way :)
I'm human