Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Prefabs Coming in Backwards

Discussion in 'Editor & General Support' started by MaddMike, May 5, 2012.

  1. MaddMike

    MaddMike

    Joined:
    Apr 24, 2012
    Posts:
    3
    I'm sure this is the easiest thing in the world to fix, I have no idea how though. I am calling a truck into a game and it comes in and drives backwards. How do I turn it around (180)?

    Mike
     
  2. AdrianC

    AdrianC

    Joined:
    Apr 22, 2012
    Posts:
    150
    You could turn it around in your 3d modeling software, or if you're using Vector3.forward for movement, just switch to -Vector3.forward.
     
  3. SarperS

    SarperS

    Joined:
    Mar 10, 2009
    Posts:
    824
    It's not a good idea to use -Vector3.forward for transform manipulation, it will cause frustration a lot like what if you want to rotate your truck left and right? Those values will be inverted too.

    Instead, create an empty GameObject and make your truck it's child. Then do all the transformation on the empty GameObject as it's rotation will return 0 on all axis. (Better yet, rotate the model on a modelling software as AdrianC suggested).