- Home /
Question by
MK7 · May 04, 2011 at 03:59 PM ·
tagchangeisgrounded
change tag if player isgrounded on specific object
I have a section of a wall that I need to change the tag of depending on what the player is grounded on. Can this easily be done? or at all?
Comment
Best Answer
Answer by GesterX · May 04, 2011 at 04:09 PM
You can dynamically change the tagof an object by simply doing:
gameObject.tag = "Player";
You can then use triggers and colliders with OnTriggerEnter and OnCollider enter etc.
For changing the tag of a "section" of a wall you have a two options (that I can think of).
- Create multiple empty gameobjects with collider/triggers and attach to the wall
- Create multiple objects for each wall section and parent them under a parent object
Your answer
Follow this Question
Related Questions
How do I change a tag? 1 Answer
Changing tag via scripting.... 1 Answer
Tiny tag changing and checking problem 2 Answers
changing the tags in an array 1 Answer