#Menu Not Clickable, 2 Canvas
1 messages · Page 1 of 1 (latest)
cool
Can you post screenshot of the RectTransform properties of both Canvases?
which is Menu ?
bottom one
Have you followed a guide to do this?
Alright. Then tutorials are actually your best bet. However, maybe I can fix this in a few minutes.
hopefully
Z-axis positions
UI -3.619999
Menu 7.8
?
check your Camera's Z axis
ah
Menu is being rendered behind the UI
so I'm guessing it's not visible as well as not clickable?
unless your UI just isn't rendering anything in front of it
the Canvas still spans its length and height
invisible or not, when you click, you hit whichever canvas is on the front
i moved it to -57
the camera?
yea
when did you move it?
hours ago
Cinemachine is THE Camera package for Unity.
Just like standard UI Text is replaced by TextMeshPro, Cinemachine replaces the default Unity Camera, with a modern camera containing all sorts of functions that you then won't have to code yourself.
However
To clarify:
i made the parent of both canvases a canvas just to try it, just now
You should probably not have moved the camera as a solution
Cinemachine will adjust its own position based on what type of view you want.
However, that doesn't have to matter.
Right now, this is what you need to realize:
alright
Canvas is 2D
So all you have to do, is adjust the Z axis of your Menu canvas, to be between the UI and Camera
Z-axis positions
UI -3.619999
Menu 7.8
Camera -57
Menu should then be something like -4
or you can use Rendering Sorting Layer
this didnt work
which I right now have forgot how to use or how works precisely
In that case - just follow a tutorial - they take less time than this conversation, and get you further 😆
just a quick ques
shoot :)
would it work if i just use one canvas instead?
Probably, but I doubt it's practical in the long run, and I don't think it's necessary
its so painful to run into a simple issue not code related after coding for 10 hours straight
but ima watch a video
thanks alot
😄 👍
10 hours of coding is a lot. Best of luck man.
Have a nice day o/
u too
https://answers.unity.com/questions/790469/should-multiple-canvas-gameobject-ever-be-used-in.html
The drawbacks of only one canvas managing all game tasks (menu, health bars, hit marker, whatever) lead to more dependency in your project, to more confusion, to less maintainability, aka to code that tends to get a mess.
tyvm, i solved it, just had to delete all buttons and copy the other ones from second canvas that was workin
huh, do you know what was different?
nope, but it worked
I prefer knowing how it's all put together, so I know I can recreate it if I mess up
results aren't my strong side lol
but quality is
hahahahahaha
thats the most important
i dont rlly care for quality since im only creating an app to help my classmates thru the math
results drive motivation and diverse learning
but it's difficult to get a good grasp as a beginner
I found the way to understanding after a few years of tumbling in the dark
well in that case, results are your friends
thats true
guess what this does
{
x1 = Mathf.Round(((-b - (Mathf.Sqrt(((b * b) - 4 * a * c)))) / (2 * a)) * 100) * 0.01f;
x2 = Mathf.Round(((-b + (Mathf.Sqrt(((b * b) - 4 * a * c)))) / (2 * a)) * 100) * 0.01f;
Method = 1;
}else if(c != 0)
{
x1 = Mathf.Round(((-b - (Mathf.Sqrt(((b * b) - 4 * a * c) * -1) * -1)) / (2 * a)) * 100) * 0.01f;
x2 = Mathf.Round(((-b + (Mathf.Sqrt(((b * b) - 4 * a * c) * -1) * -1)) / (2 * a)) * 100) * 0.01f;
Method = 2;
}else
hmm
gl
- I can't see precisely
- You should not use integers in your calculations, as an int result is always floored if the formula returns a fraction
- You should use double instead of float. It's more precise, and for weird reasons more performant.
i dont think im using int
so if you have (4 / 3) it will be rounded down inside
make a backup file
yolo
the results could be wrong if you use ints
it is correct
at least cross-check that it works, if any of your encapsulated sub-formulas are supposed to produce a fraction
alright
but make a guess
inside Mathf.Sqrt
there is ((X/Y)*100)
make sure you test a case where X/Y = a decimal number (fraction)
actually the *100 is outside the mathf.sqrt
oh well, derp, that doesn't change anything though
it's been a long time since I was in a class room doing math
although I've spent over 7 years making all sorts of formulas in spreadsheets, I can't recognize what kind of formula that is.
I forget what this is used for lol
but alright, I should probably have recognized that, if I was any versed in math :P
it is used to get the x points where y = 0
like excel?
how do spreadsheets help?
I learned math all over again by making spreadsheets for games
Spreadsheets make math fun, instead of tedious
because you can create an actual calculator with it
i can barely use them xd
and look through your math formulas in steps
oh shit
thats a good idea
i gotta try that next time
might take me a day instead of 3
Even after 7 years of active spreadsheet development, I always construct my formulas in steps, and only at the very end do I nest them into one cell (barely readable)
If you're going to use Google Sheets, you can DM me to ask for advice. I can teach you some basic stuff.
debugging a unreadable formula sucks ass
i had to use a console app to debug my formula like 8 times
good thing tho
because version 1 was very bad
I've been having fun making a script for a week, and last night I solved an issue by visualizing the array indexes and contents in a spreadsheet
it made me realize I needed index = index + index; for data and index = index + index + 1; for values
pain?
Yes. I am making a class to handle a single string as a container of 2D data
uhhh no clue what that is lmao
without using any libraries
oh shit
holiday fun
wait so string to vector2?
what?
2d data is a vector2 no?
there are also some packages that integrate Unity with Google Sheets
I have actually not tried them yet
not exactly, but abstractly kinda yeah
this is v1
the shittiest program ever
like i cant belive i made something this bad
i wish u luck
why is it bad?
full string A218G72AA309ABC123456
items A 218 G 72 AA 309 ABC 123456
I can access them by index, as an array
what is $ in cs?
$"This is a string which can output {variableName} to the string, without combining multiple strings"
oohhhh
Good night, and good luck o/
thanks and good lcuk with ur project