Turn collide behaviour on and off
imjustmike
Member Posts: 450
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
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.
Tags cannot be changed during runtime - that would be nice though!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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.
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?
Are there any specific watch outs?
You can change tags at runtime just fine ! Well it works for me at least.
EDIT: I missed that RThurman had already answered this . . .
Holy guacamole! I think you're right!
I've actually never done this in one of my projects. Wow, my life just got easier.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Yep I toyed with this a long time ago. Tag is a text attribute totally changeable
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I'm sure i've changed tags successfully during run time too. Its been awhile, but i'm sure it worked at the time.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page