- Home /
Isometric camera with Spritemanager
I followed the answer given here, but I'm facing the problem that when I try to move around my Character, it disappears.
I tried setting the Far setting to a high value (10000) and yet it helps, the Character is still hidden when I scroll far away.
These are my settings:
Hierarchy window
Camera Target
Main Camera
And I'm just copying and pasting the character position on the CameraTarget object.
// This is Character.Update
void Update () {
// [...]
cameraTarget.transform.position = gameObject.transform.position;
}
I will provide a video if this seems harder to see.
Thanks for reading!
Ok, a bunch of things here. The cameraTarget is a parent object which the actual camera follows, when you 'zoom out' you are increasing the camera's Orthographic size and your character is never so close to the camera that the near clip plane is wiping them off. Are you doing all of those things?
Yes, as you can see the CameraTarget is the parent of $$anonymous$$ainCamera, I don't know if there is something more involved to do to make him the parent. The zoom out (size setting of the $$anonymous$$ainCamera) works as you described. And in Pause $$anonymous$$ode I can see that the Character isn't being wiped by the near clip plane, but something else that I don't know.
Answer by Veehmot · Oct 15, 2011 at 10:28 PM
To all facing the same problem, this is the solution:
Forces SpriteManager to recalculate the bounding volume of the mesh in the next LateUpdate(). This is important to do periodically to ensure that Unity's visibility culling can cull the mesh when not visible, and also so that the mesh is not culled erroneously when it is visible. If your objects all remain pretty much in the same area, it is less important to call this frequently. However, if your objects move around quite a bit and the bounds are not recalculated, it is very easy for them to extend beyond the bounds of the previously updated bounding volume, causing Unity to cull the entire mesh based on the earlier boundaries, resulting in parts of your mesh which should be visible to disappear. Performance note: Will cause Unity to recalculate the bounds of the mesh, which can be very performance intensive with a large number of sprites. Consider using ScheduleBoundsUpdate() to keep from recalculating bounds each frame.
aaah. A script problem/setting. Thanks for sharing the solution. Thats very nice behaviour - I wish everyone would do that.
Answer by BerggreenDK · Oct 15, 2011 at 05:57 PM
I believe you need to ajust the "size" of the camera, right below Projection type. Instead of 15, raise this. Check the scene preview when you select the camera (double click it in the Hierachy) and see how large an area it covers.
Thanks for your answer. I believe this is not the case, as the character remains centered on the screen. He dosn't go out of the border of the screen, is just he disapeears, like if he were going through the floor mesh (which he isn't, as I checked on Pause $$anonymous$$ode).
okay, I've been testing quite a lot with this camera type too. $$anonymous$$y experience was that I keep the editor in Play mode and then fiddled around with the values of the camera into I found the working values. Then wrote them down. Stopped the Play and editing it for real.