Dynamic Splitscreen Description - A simple variation of the commonly used dynamic splitscreen, popularized by the LEGO games, implemented in unity!
Source - The source is located on github:
Hey,
Just thought I’d post about a project I’ve had lying around for a while. A while back I posted this project on GitHub thinking this would mean I could see some interesting projects being developed, utilizing it, however it seems that I forgot to post about it on here.
So I’m hoping somebody can find use of this project, although I’ll likely not be updating it too often (unless an update causes it to stop working) I’ll still check up on this post and the repository.
So go off and fork it, download it, upload it and maybe even fix it (yes it’s a little buggy).
Anyways cheers for checking out the project.
Edit: I have no clue why the image isn’t showing up, but in the meantime here’s a link.
Very nice of you to contribute that work to open source! I’ve seen one (maybe yours?) around somewhere before. Your code is however very nicely commented so will be great for learning!
I’m curious why you have the bulk of the logic in FixedUpdate() (rather than Update())? I’d have assumed the latter since it’s visual rather than gameplay/physics related? I haven’t tried the project (I’m on a phone atm) so don’t know what bugs you were referring to but could this be related?
Anyway, thanks again. I don’t need it now but great to bookmark for any future needs (Ludum Dare springs to mind )
Thanks for the support. You’re bang on with the FixedUpdate() by the way, in early tests of the program I found that using Update() caused a few visual glitches, although after modifying some of the code and fixing the problem - my use of the FixedUpdate() became redundant. I guess I just forgot to change it:smile:. Although as the docs suggest I should probably be using LateUpdate(), but the changes are insignificant.
Anyways thanks for the feedback, it’s much appreciated and if you do decide to enter Ludum Dare be sure to sent me a link to your game:).
Can someone help me understanding how the image that camera2 generates is being put on the quad to create the split screen effect. I have spend a few days with the code and have a good understanding of how it all works except for how the image of camera2 is transferred onto the quad that camera1 is seeing. I am completely new to shaders but i think it has something to do with the SplitScreenMaks shader but i cant find anything that looks like a command to get the image from camera2.
@WO_osh It doesn’t. You will see that camera2’s depth is set to 0, while camera1 (the main camera) is set to 1. This means that camera2 is drawn on the screen before camera1 draws on top of it. When the players move far enough apart to make the quad active, the quad essentially splits camera1’s view in half, revealing camera2’s view underneath.
Hello all and @CraftMuch ,
I would like to know how to fix the cameras from this asset showing too much of the screen? I need for the camera to stop at a certain point so as to not show the black unity background. Here is a picture detailing the issue. The characters are at the edge of each side of the screen. Also, can some provide some insight on how to use the Camera Control Triggers. I have them set for 2d and nothing occurs when the box colliders collide. I am using Unity 2020.