- Home /
clipping issue with sprites in fixed camera scene
I'm making a game with hand-drawn/pre-rendered backgrounds like in old Resident Evils, Final Fantasy VII, Chrono Cross, etc.
The issue I'm running into is that my cutout images of the background need to be parallel with the camera view of the scene. So for example, let's say I have a tree in my scene that the character should be able to walk behind.
The sprite of the tree will look like this in the scene:
but it's actually angled in 3D space and if my character walks to a spot that should be behind the tree, this happens:
It's even worse if I have a diagonal wall because different parts of the wall will have different depths. So how would I solve this issue?
Is there some way to apply the depth of a different object to this sprite? If I could use an invisible cube's depth for the tree, then I could solve the entire issue. The cube's depth would be an accurate representation of where the tree is supposed to be in 3D space.