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. Dismiss Notice

Problem with models - coordinates axes

Discussion in 'Getting Started' started by sito_28, Jan 19, 2016.

  1. sito_28

    sito_28

    Joined:
    Jan 19, 2016
    Posts:
    9
    Hello,

    i have a problem when I import a model in Unity with the coordinates axes. The ball is in the coordinates axes

    the Ship Model is not in the original coordinates axes. look at the image. can i solve it in Unity?

    Regards
    Alfonso
     

    Attached Files:

  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    I see the problem. You're using the Y-Wing and not the obviously superior X-Wing. ;)

    But for realzies, this would have to do with how the model was created/exported from the modeling program it was created in. Do you have the original file, or did you get this from somewhere else?
     
  3. sito_28

    sito_28

    Joined:
    Jan 19, 2016
    Posts:
    9
    I haven't the original model, I find it in internet. Can Unity solve it?
    Thank you
     
  4. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    Not that I know of. If you can't edit the actual model, your best bet would be to put the mesh object inside an empty game object, with the mesh offset to displace it back to the center of the empty object. Do your movement, rotations and such on the empty object then instead of the ship mesh itself. Kinda hacky, but should work, I'd think.
     
  5. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,840
    It's not all that hacky. It's pretty much standard practice.
     
  6. sito_28

    sito_28

    Joined:
    Jan 19, 2016
    Posts:
    9
    Hello,

    i tested the empty object but i have the same problem when i round the ship about the ball.

    when the ship spins up around the other object , it works but if the ship spins up around the other object and the distance increases, the ship begins to turn on itself and the other object. I only want the ship spins up around the other object and the distance increases but i don´t want the ship turns on itself.
    Thank you and regards.
     
  7. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    Really? I thought standard practice was for models to have their center point located where their base of movement should be (centered at ground level for characters and CoM/CoG for vehicles). Unless you meant just having the model object inside another, like how you'd add a character to a Third Person Controller object and manipulate that instead of the model directly.

    @sito_28 Are you sure you offset the model correctly? Are you only applying rotations/translations to the empty parent object? If aligned correctly, you should be able to rotate the object in the editor and the ship should spin in place.
     
  8. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,840
    It's great when your models come in segmented and positioned exactly how you want them. But in real life, in my experience at least, it's quite common for that to not be the case; the position is offset, or it's rotated the wrong way, or the model is divided into several pieces, or whatever. Artists often have a rather tenuous grasp of the needs of the code (though no more so than programmers have a tenuous grasp of the art tools!). So, no big deal: you create a parent object, throw the model(s) inside and position them exactly how you want them, add colliders and mount points and whatever else you need, and Bob's your uncle.

    As for @site_28's problem, I can't make out what it is. But your advice certainly seems sound to me!
     
    Last edited: Jan 20, 2016
    Schneider21 likes this.
  9. sito_28

    sito_28

    Joined:
    Jan 19, 2016
    Posts:
    9
    Hello.

    look at the screenshot.

    regards and thank you
     

    Attached Files:

    Last edited: Jan 20, 2016
  10. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    Two things I'm seeing:
    1. You've offset the empty parent object, when what you should be doing is offsetting the Y-wing object so that it's centered at the center point of the empty parent.
    2. Your rotation script Rotar is on the Y-wing object when it should be on the empty parent. Remember, due to the strange offset, you need to rotate the parent.
     
    JoeStrout likes this.
  11. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,840
    Yep. Think of the Y-wing object as just the model. It's not the Y-wing itself; it's merely a mesh that you stick inside the parent object. The parent object "is" the Y-wing in your game. It will have the physics (Rigidbody) if you need that, the colliders, any behavior scripts, everything. The model object will have nothing except the mesh; its only job is to make your Y-wing actually draw on screen. Everything else goes in and on the parent.
     
    Schneider21 likes this.
  12. sito_28

    sito_28

    Joined:
    Jan 19, 2016
    Posts:
    9
    thank you ;) it works.
     
    JoeStrout likes this.
  13. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
  14. sito_28

    sito_28

    Joined:
    Jan 19, 2016
    Posts:
    9
    Thank you for the explanation ;)