playMaker

Author Topic: Tag Inheritance  (Read 4461 times)

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Tag Inheritance
« on: July 08, 2011, 07:21:30 PM »
Simple question: do child objects inherit the tag of their parent? 

My game features snow.  The player walks through it, and the snow drifts disappear (scale down, spawn fx, etc). 

I have a large object parented to the player which is about 8 meters in front of it.  It has no FSM, and is tagged as something other than "Player".

There is an FSM on the player which waits for an OnTriggerEnter event with the snowdrifts tag, and then triggers a state where the contacted snowdrift performs it's actions.

Now, when I walk into a field of snowdrifts, they will begin to disappear when this large object touches them. 

If there is no unknown tag-relative hierarchy in Unity, I think this may be a bug.  Can anyone help me with this?

LordShaggy

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 50
Re: Tag Inheritance
« Reply #1 on: July 08, 2011, 08:45:45 PM »
Unless you set this in unity, no.   Tag inheritance is not automatic.

Does your players FSM go off to do the things for the snowflake when they hit the large object?   I would suggest shrinking your object down, it sounds like there are a few configurations in unity proper that might need to be flipped on.

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Tag Inheritance
« Reply #2 on: July 08, 2011, 08:56:59 PM »
> Does your players FSM go off to do the things for the snowflake when they hit the large object?

Yes.  The only FSM on my player at the moment is a simple, two-state FSM that waits for the trigger effect, and then scales it down and spawns the associated effect.  It triggers every time my large object interacts with the snowdrifts.

Before I posted the initial question I searched everywhere for Tag Inheritance topics.  It sounds like there IS such a thing (I was guessing just based on the behavior).  Could you possibly link me to some information on the topic, or explain how I can enable/disable this if there are settings related to such in Unity? 

Unfortunately I can't scale the object causing the issues down, because there are slopes and uneven surfaces in the game, and one way or another it will end up interacting with these objects at some point. 

I could disable it and enable it when it's needed, since it's only used when the player is not moving.  I'm reluctant to do a workaround though because, especially over the last few days, I've been getting lots of wierd behavior, so I'd like to separate what might be a bug from what might be odd code/script.  In this case the only other hypothesis I had was that it was a bug, because it certainly seems like one. 

Thanks for your help man.  Much appreciated.

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Tag Inheritance
« Reply #3 on: July 08, 2011, 09:24:41 PM »
Did you make the big object have a collider on it, and are using a genertic "on collission enter" to trigger your FSM?

That's why it might be accidently firing...

try tagging your big object and then specify which tag in the collision you require instead of accidently "everything"

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Tag Inheritance
« Reply #4 on: July 08, 2011, 09:29:08 PM »
Nope.  I try to use custom tags for as much as possible.  I think "FINISH" is the only native one I am using in this project at this time, and not on these FSMs in particular.

My large object is a gameobject with only a spherical physics component on it, and it's tagged something completely different. 

The player object, which has the FSM that interacts with snowdrifts, just has a start state that looks for OnTriggerEnter with the tag of "snowdrift", which is the tag on the drifts themselves. 

Very odd.