GameSalad

Howdy, Stranger!

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

how do i get the folow actor to destroy the folowed actor after being destroyd?

heya i find myself in a pickle again..i have made a custom colition box at the feet of my player so that it follows along as it moves for the sole purpose so that my player can move behind or in front of objects.so it doesn't just get destroyed when touching any part of it.so how do i get it so that when that attached actor touches or collides with something it destroys or in this case kills the player ? i'm making an endless runner and want some items to pass by my character unless it touches say the base of that object and kills it.

Comments

  • tatiangtatiang Posts: 11,791Member, Sous Chef, PRO, Senior Sous-Chef

    You can communicate between actors by doing something like this:

    collisionBox actor

    When actor collides with [something]
         Change attribute game.collision to true

    player actor

    When attribute game.collision is true
         Destroy actor

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ToqueToque Posts: 1,181Member

    Here is a demo.https://www.dropbox.com/sh/7l2yqdmf0dq6y79/AAD80vZvupwcXuC9MPGEqqXZa?dl=0

    Game attributes can link many things together in the same scene or even in different scenes.

    Its good to understand as you will use it over and over and over again........

  • CrimzinsnowCrimzinsnow Posts: 13Member

    thanks for all the advice again.@tatiang the second part witch behavior gets called?i got it all up to that part.im prob just overlooking something and toque ile give that a try thanks.

  • CrimzinsnowCrimzinsnow Posts: 13Member

    nvm i got it right ur advice was on the spot thanks,was using wrong behavior,its prity simple but even just one thing can make the whole thing not work,im lerning so much so quick,hate hitting a wall just cos of one small thing.thanks alot u guys are great

  • tatiangtatiang Posts: 11,791Member, Sous Chef, PRO, Senior Sous-Chef

    You're welcome!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.