Forum rules - please read before posting.

Game Camera 2D tracking issues

When using Game Camera 2D, and unchecked Lock? in order to follow the Player, I encountered a few issues:

1) Target direction factor only works when the Player's Turn root object in 3D space? option is checked, which is not a big problem. But since I am also using Move with Rigidbody 2D? to avoid jittering motion when the Player is walking into colliders, AC suggests me to turn the Turn root object in 3D space? option off. May I ask what are the possible problems of using urn root object in 3D space? and Move with Rigidbody 2D? together?

2) When Target direction factor and Track freedom are both non-zero, Track freedom kind of giving the same effect of Offset.

Are those real issues or I just made some wrong settings? Thank you for advice.

Comments

  • 1) The suggestion is made because of the way Unity's physics system is intended to be used.  I'll look into the Target direction factor not respecting characters that don't turn in 3D space.

    2) I'm not sure what you mean exactly.  Are there values you can give to the 2D Demo's NavCam to demonstrate?
  • 1) A good news is so far I haven't encounter any problem for using Turn root object in 3D space? and Move with Rigidbody 2D? together though.

    -------------

    2) Actually I just found the Track freedom value is useful when only being used alone.

    But once if Offset has a non-zero value, the Track freedom value will add to the Offset value: 
    e.g. if Offset = 1 & Track freedom = 1, the effective result is Offset = 2 & Track freedom = 0.

    If Target direction factor has a non-zero value, the Track freedom value will add to the Target direction factor value:
    e.g. if Target direction factor = 1 & Track freedom = 1, the effective result is Target direction factor = 2 & Track freedom = 0, also with some fast camera movement when the camera center passes the player when catching up from behind.

    If both Offset and Track freedom are non-zero, Track freedom will still add to Offset.

    -------------

    3) Another relatively simple issue is, if the Game Camera 2D has any non-zero transform position (either in x, y, or z), when the game is run, those x y z values will become additional camera offsets from the player on top of the camera tracking settings.

    This could be solved by not using non-zero transform position for the camera, but it would be quite inconvenient when designing the scene. The 3D NavCam doesn't has this problem.
  • edited June 2018
    1) The next update will allow Target direction factor to work with characters that have Turn root object in 3D space? unchecked.

    2) While I see your point about the two sets being equivalent, I'm not sure this classifies a bug.  Bear in mind that it's always possible to incorporate your own custom camera script should you want/need to - see the "Custom cameras" chapter of the Manual.

    3) From what you describe, that's as it should be - otherwise, the camera would reset to the origin when the scene begins.  The Offset value can be changed to make corrections.
  • 1) Thanks in advance

    2) When I was trying to write my script, I too realized it is difficult to decide what is the desired effects of using Track freedom together with the other 2 settings. I will leave use only the Target direction factor for now.

    3) I understand, but the 3D NavCam doesn't seem to have this issue. I personal think the 3D case is more convenient in building the scene, just a thought.
  • 1) A good news is so far I haven't encounter any problem for using Turn root object in 3D space? and Move with Rigidbody 2D? together though.

    I realized a problem now, the horizontal movement would be lagged and jiggled if using both the Move with Rigidbody 2D? & Turn root object in 3D space? together. The effect is subtle when the character moves slow, but it is more obvious when moving faster.
  • In line with Unity best practice, a 2D Rigidbody should not be rotated along the Y-axis when moving it.  The Turn root object in 3D space? option exists to prevent exactly this.

    I don't recommend having both checked, which will cause jittering not just with the camera but with the character too.  I should note, however, that if the Rigidbody2D has Is Kinematic checked, then the Rigidbody2D will be moved directly, as opposed to having a force applied - it may be that this gives improved results.
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.