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

Sprite based characters in a 3d enviroment?

Discussion in 'Editor & General Support' started by Okottekoneko, Jun 16, 2015.

  1. Okottekoneko

    Okottekoneko

    Joined:
    Jun 14, 2015
    Posts:
    20
    Can someone please point me in the right direction.

    i have looked for tutorials but all i get is stuff for sidescrolling games.

    i want to make a 3d environment but have characters and some objects as sprites.
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    Just create sprite gameobjects and have a script which faces them towards the camera, perhaps changing sprite based on angle the character/object is facing, you know, to see the various angles from a character/object. For instance when a person is facing away (or close to facing away) from the camera, show the person's "back" to the camera. And if they are 45 degrees to the right.... you get what I mean?
     
  3. Okottekoneko

    Okottekoneko

    Joined:
    Jun 14, 2015
    Posts:
    20
    i thought it would be something like that, i have done it in flash before, but i have never used unity before, i was hoping there may be a tutorial somewhere that shows how its done.
     
  4. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    I don't know of any specific tutorials but maybe you could try using "lookat" (http://docs.unity3d.com/ScriptReference/Transform.LookAt.html) pointing to the camera.main?
    I've never tried tris but it might work.
    Depending on how you want the sprites to behave you might also need to restrict one axis so they dont turn when the camera is facing at a high angle.
     
  5. Okottekoneko

    Okottekoneko

    Joined:
    Jun 14, 2015
    Posts:
    20
    not really what i am after.

    i need to find a way to have the sprites replace 3d objects like the player and NPC's etc
     
  6. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    Yeah I'd avoid look at just because it would screw up the rotation on one axis (might work if your camera was first person and the whole game took place on a single height) and instead try to code a way to have the y rotation of the sprite face the player (or the players camera that is) and then you'd need to code a way to determine approximately what facing the sprite is in relation to the player camera. Maybe just try downloading a generic sprite sheet character that has 8 directions of facing (sprites of his front, side, back, other side, and one sprite in between each of those) and try to test out measuring the angle he is facing, and compare with the angle towards the camera - and this way you could make it like "doom" (the original, not that extremely awesome one they announced at e3) where characters move in full 3d, but really only have limited facings based of player position.

    I might be rambling. Haha.
     
  7. Okottekoneko

    Okottekoneko

    Joined:
    Jun 14, 2015
    Posts:
    20
    this may help.
    this is what i was playing when i got the idea for my game. recettear


    my game is not a carbon copy, mine takes elements from the above, mixed with elements of old school harvest moon and the dungeoning elements of rune facotry (HM and RF are from the same franchise i know but HM is different.)

    the camera will be fixed in direction, 45degree or so from above, the player will be in the centre of the screen, and the scene moves around them, instead of a 3D asset like an animated mesh i want to use 2D assets like sprites, the games world will be 3D, and having some elements of it being sprite based, like items, monsters and interactive items.

    what i need is something that will allow me to have a 3D world and incorporate 2D assets into it.
    its not a camera issue its asset implementation especially with the player themselves and collision.
     
  8. Okottekoneko

    Okottekoneko

    Joined:
    Jun 14, 2015
    Posts:
    20
  9. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    There was a pokemon fan game on here not too long ago (probably in wip) that had 2D sprites in a 3D environment. It was actually a pretty cool effect. I think the guy said he was mocking up similar to a DS game. Sorry can't be more specific.