Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

What is the best way to tag a position in a mesh?

Discussion in 'General Graphics' started by ripridehi, May 27, 2015.

  1. ripridehi

    ripridehi

    Joined:
    Mar 27, 2015
    Posts:
    15
    I would like to be able to tag a specific position on a mesh via an external tool, then get that position at runtime. For example, I have some sort of model, and I want to be able to emit particles from a location on that model. I need to be able to specify that location in an external modelling tool, then read that position when the mesh is loaded at runtime. What is the best way to do that? Are there multiple options to achieve this?
     
  2. OlavoDias

    OlavoDias

    Joined:
    May 2, 2015
    Posts:
    13
    Just one idea...

    - Create an Empty Game Object (let's call it MainObject)
    - Add your mesh underneath the MainObject
    - Add an empty game object underneath the MainObject.
    - Set the transform of the empty game object to be the point where you want to emit particles.

    But if this is a character, then you would be in trouble if this character has animations... because you would have to move this empty game object according to the animation as well...

    P.S.: don't forget that the movements and rotation must be applied to the MainObject, so both the mesh and the empty game object will move/rotate accordingly with the parent object.
     
    theANMATOR2b likes this.
  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    If - it is a character you could add a dummy bone in the rig where you want the particles to emit from. Animate it if needed. Then when in Unity use this dummy bone to link a empty game object to so the particles will emit from that spot.
    If the rig needs to stay how it is - you could use one of the existing bones to parent a empty game object to - where the particles will emit from.
     
    OlavoDias likes this.
  4. ripridehi

    ripridehi

    Joined:
    Mar 27, 2015
    Posts:
    15
    Thanks for the suggestions. I'm looking for a way to tag static geometry (not animated) in an external tool, rather than in the Unity Editor. If it's tagged in the Unity Editor, that is an extra step every time the mesh is modified in your modelling tool.