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.

Working with a 2D sprite in a 3D Game

Discussion in 'Getting Started' started by joemost29, Jul 16, 2015.

  1. joemost29

    joemost29

    Joined:
    Jul 2, 2014
    Posts:
    11
    Hey Guys,

    I am working on creating a 3D game with unity using 2D sprites as some of my players. I have them automatically "billboarding" towards the camera. Once in the scene, do they behave pretty much like a regular 3D object would? Can I use Vector3's or normal 3D rigidbodys on them?

    does anyone have an example game that does this that I could look at?

    Hopefully I am on the right track.

    Thanks guys..
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,815
    Yep. You can even mix 2D and 3D objects however you like. To Unity, it's pretty much all the same.

    Have fun,
    - Joe
     
  3. tedthebug

    tedthebug

    Joined:
    May 6, 2015
    Posts:
    2,570
    would you need to discern between 2d & 3d colliders when doing collisions & triggers? Eg the 2d object had the trigger & gets hit by the 3d then it uses OnTrigger2d but if it was the other way it would use the usual OnTrigger?
     
  4. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    812
    2D and 3D colliders are about the type of game, not the type of object. As in, use 2D colliders for a 2D game (eg. flat side or top view), but use 3D colliders for a 3D game (and that includes OnTrigger vs. OnTrigger2D). That is true for both meshes and sprites; you can have 2D sprites in a 3D game, and you can have 3D objects (just seen from one side obviously) in a 2D game.