Forum rules - please read before posting.

Double-sided Sprites that animate

In my scene I've got a simple two-way conversation taking place between my player and an NPC around a dinner table. As the conversation goes on, two cameras switch back and forth in similar over-the-shoulder shots, depending on which character is talking. The characters are 2D sprites in a 3D environment (all setup using the AC documentation).

Can both characters to have both front and back sprites? so when I cut to the reverse shot we see the back of one character and they're not both facing the camera at the same time. The billboarding effect is great, as it keeps the alignment of the sprites perfect to the camera, but it's always the front-facing sprite pointing toward camera. How can I make my sprites double sided, while maintaining this cool billboarding effect?

To build on this... I also need to animate the sprites during the conversation. Usually the front side will animate as they talk, but I don't want the reverse sprite showing through from behind. How can I achieve this?

Thanks in advance :)




Comments

  • I'm not clear what you mean by front and reverse-facing sprites - there should only main sprite for each character.  Do you mean the various up/down/left/right sprites?  If you've set up a 2D character to use multiple directions (such as the 2D Demo's Player prefab, Brain2D), then the character will automatically play the correct directional-animation even in a 3D environmnent.
  • I should have elaborated more...

     For example, the "front sprite" would be the face of the target while the "back sprite" would be the back of the head.

    At the moment I'm achieving this by having two sprites sandwiched very close together, one is of the players back and the other the players front.

  • I still don't get it, sorry.  You mean there's a "front of head" sprite and "back of head" sprite?  You shouldn't need that.  If the character is facing away from the camera, it'll play the "_U" animation (for up); if facing towards, it'll play "_D" (for down).  You can set up these animations to use the "back of head" and "front of face" sprites respectively - no need for double-sided sprites.
  • I've taken some crude screenshots to show what I mean...


    In Shot 2 I've added another sprite of her "back" just to show how I want it to look. In Shot 1 you can see how he turns to face the camera at all times.

    Now, I see what you're saying about the '_U' and '_D' animations, but what happens if he is idle while she is animating?... how do I tell AC that when the camera switches to run his 'Idle_D' animation instead of 'Idle_U' when he hasn't technically moved?

    Does that make more sense?

  • If you're playing an Idle animation, then AC will handle the switching of "_U" to "_D" automatically.  Try it with the Brain2D player prefab from the 2D Demo - if you place him in a 3D scene and cut the camera, he'll always face the right way.
  • Excellent, I'll give it a try.

    Thanks Chris!

  • I followed your instructions and got this working, I continued building my scene and somewhere along the way it's stopped working.

    To test I replaced my player with Brain2D.prefab and it's working fine. I haven't touched my own player prefab since I got it working, so I'm confused to why it's doing this.

    While game is running I jump over to the scene view, if I fiddle with the camera rotate values the sprite suddenly pops round the right way.

    I've also tested with static and animated cameras, but it makes no difference.

    Here's a download link to my player prefab - http://bit.ly/1Dz7XQd


  • Download file doesn't work, but please only provide links when I ask for them.  But if it's working with Brain2D, then there must be some difference between the two prefabs, even if it's seemingly insignificant.  I'd suggest focusing on the Animator component.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.