Some interesting finds about overlap and collide

Okay so maybe I never knew this and maybe because I tend not to have lots of layers in a project so maybe I never ran into this.

I found that when actors are on other layers the collide behavior works across layers. I just had an issue with the rule condition OVERLAP AND COLLIDE and found that if the two actors are not on the same layer the condition doesn't fire. Is this how it's always been? As I said usually if I have walls I will put them in a bottom layer out of the way and have a layer for the rest so I may have just never had this situation before.

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Wow, never really ran into that problem before - interesting find. Not sure if it's always been like that...
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yeah I tried a bunch of stuff then though oh maybe check the layer just in case. I had a debug statement in a straight naked rule with when overlaps and collides and it fired in the same layer and didn't in different layers. I sent a PM to @codewizard about it.
  • SolarPepperStudiosSolarPepperStudios Member Posts: 754
    I think I've noticed that before but ignored it. At the time it wasn't a big deal. I could think of some ways to fix that though. :) All it would require are some constrain attributes, rules and a little bug fixing. :D
  • POMPOM Member Posts: 2,599
    Mind posting a project example?
    Collision should work across layers if set properly..

    Roy.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    I remember seeing something like this before, a while back. If I put the object on the same layer, and scripted it, and then moved it from that layer to another, it wouldn't work properly. But if I put it on another layer first, then scripted it, it would work. This was several releases back, like in the 9.something era, though.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yeah I'll try it in a dummy project as this happened in a project I'm contracted on.
  • DanielDoeDanielDoe Member Posts: 307
    edited May 2013
    In "Emilly In Darkness" I was using collisions across many layers all the time and it always worked. Moreover after switching to 0.10.3 everything works the same way... strange.
  • LumpAppsLumpApps Member Posts: 2,881
    FYI I am on 0.10.1 and am sure it's not the case there. I am using overlap and collide in Bunny Balls between actors on different layers.
  • POMPOM Member Posts: 2,599
    I'm thinking you have a scrollable and unscrollable issue there, but I'm waiting for the sample file..

    Roy.
  • DanielDoeDanielDoe Member Posts: 307
    I checked my project, and I use 15 diffirent layers and 5 of them are used for "active" objects with collision detection and it works fine.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    I just tried it in a project and it works even when I move them in and out of layers. It seems like something broke in the project I was working on an got reestablished when I brought it into the layer.
  • POMPOM Member Posts: 2,599
    yeah i figured it was the case..
    make a copy and start comment out rules until youll find the issue, my guess is that it related to scrollable/none scrollable layers..

    Roy.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Nah it's a single screen game and all the layers there are only two are both scrollable. This was a weird one.
  • LumpAppsLumpApps Member Posts: 2,881
    Please let us know what you find, if anything
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    If both actors are set to not Movable, collision detection doesn't happen.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Nope one was moveable. Nothing changed in the code other than I moved one to the same layer as the other. Sometimes it would fire once when they were on separate layers and then they just stopped working. That's when I put in the rule with the debug and saw it wasn't firing this included all the other balls that were spawning as colliding as well. Something was broke somewhere on the backend. Not sure what it was as all that changed was the layer and there are eight separate actors that weren't acknowledging the collision either all movable.
  • ericzingelerericzingeler Member Posts: 334
    A quick reminder for those who may not know...

    Actors are run in order from bottom to top, and actions within actors from top to bottom. Just wanted to throw this out there as you mentioned you were moving actors between layers.
  • LumpAppsLumpApps Member Posts: 2,881
    Any constrains in there? They can cause trouble detecting collision and overlapping.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited May 2013
    We know that. This has to do with a rule executing on overlap and collide not when something fired but the fact it didn't fire during execution.

    @ludwigheijden actually this is a rare project where I am using gravity so the actor was falling straight down and there is an actor at the bottom and a simple rule when overlap and collide destroy actor. It worked for a few previews and then stopped all of a sudden. So I put in the debug behavior to see if the rule was firing and it wasn't. I trashed the rule and made a new one and still nothing. Then I changed out the actor on the floor and redid the rule and still nothing. I thought after scratching my head maybe it's in the lower layer and when I moved the floor actor to the same layer as the ball it started working. Not sure if the ball actor was corrupted somehow or what. I know I've had actors just get corrupted. I suspect it was something like that something got corrupted on the backend and moving that actor somehow reestablished the disconnect.
  • RiffelRiffel Member Posts: 1,272
    I have this problem with display text behaviour
  • WbokoWboko Tennessee, USAMember, PRO Posts: 621
    I had that happen on my "Wboko Balls" game but only when one was moveable and one was not... But still weird...
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    So an update. I opened the project this morning to find it not working again..Hmmm so I threw a collide behavior in the non-movable actor and now it fires....I'm puzzled by all this.. I've checked all the usual suspects even made both actors movable and constrained the fixed actor yesterday and it didn't work. Something is rotten in Denmark but I can't find the pattern of events. The project was built in 10.2 and worked fine for weeks then I brought it into 10.3 and after a day it stopped working and none of the code related to this was changed. I should mention that all the balls are duplicates of the first one I built and then renamed as they all share the same code except for a change to an identifying self attribute which is a very common practice. I've notices issues when duplicating actors before as sometimes they stay linked to the original as I've seen code I changed in one affect the duplicate actor and mind you the actor was duplicated in the actors palette not on screen and renamed so this happens across duplicate actors in the actors palette.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    So a new update it stopped again and it seems like the actors are hitting something that is not there like an old floor actor or something...grrrrrr. So I just went with a Y position destroy and it works great. Not sure what went wrong behind the scenes.
Sign In or Register to comment.