Pages 1
Universal Fighting Engine Forum Due to increased bot activity, we have discontinued support through the forum. For assistance, questions, and community discussions, please join our official Discord server |
You are not logged in. Please login or register.
Universal Fighting Engine Forum → Source Coding → Screen Space Camera?
Oh, I just figured out how to do this the other day for my project! Here's how I did it.
in DefaultBattleGUI.cs At the top of
public override void OnShow ()
I just added
UFE.canvas.renderMode = RenderMode.ScreenSpaceCamera;
UFE.canvas.worldCamera = Camera.main;
UFE.canvas.sortingLayerName = "UI";
The last line there may not be needed for yourself, I was doing it so my characters could jump in front of the UI.
If that's what you're going for, I recommend giving all your UI elements a shader with ZTest Always. And if you want some UI elements in front of your characters, you should add a secondary canvas to your BattleGUI prefab with a different sorting layer, that's how I got it to work for me!
Anyways, best of luck!
@starcuttter. That worked Perfectly Thanks a million.
@Starcutter I added the code but When I try to change the ZTest the bottom UI that holds my Special bars do not appear in front of my background. My game is 2D so that might be why. Do you have any suggestions?
@Starcutter I added the code but When I try to change the ZTest the bottom UI that holds my Special bars do not appear in front of my background. My game is 2D so that might be why. Do you have any suggestions?
Hmm, if your background is just a flat image, You may want to try messing with the sorting layers? Sorry if I'm not much help and good luck!
Universal Fighting Engine Forum → Source Coding → Screen Space Camera?
Powered by PunBB, supported by Informer Technologies, Inc.