Forum rules - please read before posting.

3D camera rotation with 2D characters gives weird results

Heyo,

I've been making a 3D game with 2D sprite characters. It all works really well, but I've found something weird when trying to make the cameras follow the player: when the camera is rotated 180 degrees and has to follow the character (either with X position or spin rotation), it interprets the direction the wrong way around. When the character moves to the 'right' on the screen, he's actually moving left on the X axis in world space, if you know what I mean. But the camera seems to always move according to its own relative X axis, which goes into the other direction (because it is rotated, its local X axis is rotated 180 degrees from the world's X axis or the character's X axis).

I have a character made through the wizard:
- position 6X 0Y -4Z
- animation engine: sprite unity
- motion control: automatic
- multiple directions on
- diagonal sprites on
- frame flipping: none
- rotate sprite to: camera facing direction
- turn root object in 3D: on
- move with rigidbody: on

The camera:
- position 6X 1Y 0Z
- rotation 180 Y to face character

Comments

  • What's the camera type, GameCamera?  And the AC/Unity version numbers?

    It's a bit hard to imagine - is the issue with the way the camera moves, or with the display of the character?  If with the camera, does it occur if you drop in e.g. Tin Pot from the 3D Demo instead of relying on a 2D character?

    I think it's be best to see this for myself - if you can duplicate the scene, strip away everything except a simple plane to move around in (i.e. no extra graphics needed), make a .unitypackage of the scene file and PM it to me.  If it breaks with Tin Pot too, that'll be enough - otherwise, I'll need your character (prefab + sprites + animation) too.
  • Gosh this is so bizarre:

    I made a new empty scene in the project, threw down a plane with a navmesh and playerstart, added a gamecamera, rotated it 180 degrees and set it to follow my player, then hit play. Works perfectly, of course. The spin rotation did go the wrong way, but I could fix that by setting the influence to -2 instead of 2.

    I added a gamecamera the exact same way to my other scene, and as soon as I hit play it flies all over the map. For following the X position I have to set the influence to 0.01 to even get it near my character, otherwise it shoots off a mile away. And I have to set a massive offset to get the spin rotation to face the player. Very strange. The components and all are the same, no weird layers or nesting.

    I'll make a stripped-down version of the scene tomorrow to send it to you for diagnosis.
  • Please also follow the test of using Tin Pot in your broken scene - it's an important part of the diagnosis.
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.
Do NOT follow this link or you will be banned from the site!