GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Turn collide behaviour on and off

I have an actor that I want to toggle collision behaviours with - when actor is active, collide with actor with tag, when not active, stop colliding.

I've got a very simple rule wrapper around the collide rule (when active - collide, otherwise - nothing) but this doesn't work. It seems that once the collide behaviour has been activated, it can't be turned off? Is this a bug? I've seen lots of old forum posts about this issue but none that were resolved.

Comments

  • imjustmikeimjustmike Posts: 450Member

    Ignore me - conflicting rules in a different actor because of tags. Though, that leads me to a question - can you change the tag of an actor during run time? I see the attribute available, but can't seem to make it work.

  • Braydon_SFXBraydon_SFX Posts: 8,959Member, Sous Chef, PRO, Bowlboy Sidekick GameSalad Employee

    Tags cannot be changed during runtime - that would be nice though!

  • RThurmanRThurman Posts: 2,821Member, Sous Chef, PRO

    Last time I checked, tags could be changed anytime. Though using them at runtime takes a little finesse. Just think of them and use them as a text attribute.

    Also using runtime tags with the collide behavior needs a little TLC but it can be done.

  • imjustmikeimjustmike Posts: 450Member

    I spoke too soon, it turns out I can't get the collide to work properly with multiple actors. What I'm trying to achieve is a tower of blocks of the same actor, clicking one makes it "inactive" which triggers it turnings invisible (I don't want to shrink it or move it as eventually I want to animate it) and stops it colliding with other blocks.

    However, I can't get this to work. Weirdly, when I have multiple actors stacked, the turning off collide behaviour only works when I make all of the blocks "inactive. I've included a demo below - just click the white actor to make it inactive.

    https://www.dropbox.com/s/c78w61mkf4v3mr8/colliding_blocks.zip?dl=0

    Is there any work around with this? Is it a bug?

  • imjustmikeimjustmike Posts: 450Member

    @RThurman said:
    Last time I checked, tags could be changed anytime. Though using them at runtime takes a little finesse. Just think of them and use them as a text attribute.

    Also using runtime tags with the collide behavior needs a little TLC but it can be done.

    Are there any specific watch outs?

  • SocksSocks London, UK.Posts: 12,822Member
    edited August 2015

    @Braydon_SFX said:
    Tags cannot be changed during runtime - that would be nice though!

    You can change tags at runtime just fine ! Well it works for me at least.

    EDIT: I missed that RThurman had already answered this . . .

  • Braydon_SFXBraydon_SFX Posts: 8,959Member, Sous Chef, PRO, Bowlboy Sidekick GameSalad Employee

    @Socks said:
    You can change tags at runtime just fine ! Well it works for me at least.

    Holy guacamole! I think you're right!
    I've actually never done this in one of my projects. Wow, my life just got easier. ;)

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,913Member

    @Braydon_SFX said:
    I've actually never done this in one of my projects. Wow, my life just got easier. ;)

    Yep I toyed with this a long time ago. Tag is a text attribute totally changeable

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,539Member

    I'm sure i've changed tags successfully during run time too. Its been awhile, but i'm sure it worked at the time.

Sign In or Register to comment.