#Menu Not Clickable, 2 Canvas

1 messages · Page 1 of 1 (latest)

analog dust
#

I made a thread for this

sullen plover
#

cool

analog dust
#

Can you post screenshot of the RectTransform properties of both Canvases?

sullen plover
analog dust
#

which is Menu ?

sullen plover
#

bottom one

analog dust
#

Have you followed a guide to do this?

sullen plover
#

i have done this myself hehehe

#

i have always been terrible on ui

analog dust
#

Alright. Then tutorials are actually your best bet. However, maybe I can fix this in a few minutes.

sullen plover
#

hopefully

analog dust
#

Z-axis positions
UI -3.619999
Menu 7.8

sullen plover
#

?

analog dust
#

check your Camera's Z axis

sullen plover
#

ah

analog dust
#

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

sullen plover
#

menu is being rendered beside it

#

ill send a screen

analog dust
#

the Canvas still spans its length and height
invisible or not, when you click, you hit whichever canvas is on the front

sullen plover
#

oh

#

so how do i make it work? do i just make one canvas instead?

analog dust
#

Cameras are usually at -10 on the Z axis

#

what is yours?

sullen plover
#

i moved it to -57

analog dust
#

the camera?

sullen plover
#

yea

analog dust
#

when did you move it?

sullen plover
#

hours ago

analog dust
#

why?

#

are you using Cinemachine?

sullen plover
#

i wanted to make sure stuff is visible

#

what is cinemachine?

#

oh

#

nope

analog dust
#

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:

sullen plover
#

i made the parent of both canvases a canvas just to try it, just now

analog dust
#

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:

sullen plover
#

alright

analog dust
#

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

sullen plover
analog dust
#

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 😆

sullen plover
#

just a quick ques

analog dust
#

shoot :)

sullen plover
#

would it work if i just use one canvas instead?

analog dust
#

Probably, but I doubt it's practical in the long run, and I don't think it's necessary

sullen plover
#

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

#

😄 👍

analog dust
#

10 hours of coding is a lot. Best of luck man.
Have a nice day o/

sullen plover
#

u too

analog dust
sullen plover
#

tyvm, i solved it, just had to delete all buttons and copy the other ones from second canvas that was workin

analog dust
#

huh, do you know what was different?

sullen plover
#

nope, but it worked

analog dust
#

lol oh well

#

success \o/

#

Good stuff

sullen plover
#

hahahahaha

#

like they say if it works dont touch it

analog dust
#

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

sullen plover
#

hahahahahaha

#

thats the most important

#

i dont rlly care for quality since im only creating an app to help my classmates thru the math

analog dust
#

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

sullen plover
#

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
analog dust
#

hmm

sullen plover
#

gl

analog dust
#
  1. I can't see precisely
  2. You should not use integers in your calculations, as an int result is always floored if the formula returns a fraction
  3. You should use double instead of float. It's more precise, and for weird reasons more performant.
sullen plover
#

i dont think im using int

analog dust
#

4 is an int

#

4f is a float

#

4d is a double

sullen plover
#

ah

#

ehh if it works

analog dust
#

so if you have (4 / 3) it will be rounded down inside

sullen plover
#

im scared to tocuh it bruh

#

it took me 3 days to get this code

#

to work

analog dust
#

make a backup file

sullen plover
#

yolo

analog dust
#

the results could be wrong if you use ints

sullen plover
#

it is correct

analog dust
#

at least cross-check that it works, if any of your encapsulated sub-formulas are supposed to produce a fraction

sullen plover
#

i have quadruple checked

analog dust
#

alright

sullen plover
#

but make a guess

analog dust
#

inside Mathf.Sqrt
there is ((X/Y)*100)
make sure you test a case where X/Y = a decimal number (fraction)

sullen plover
#

actually the *100 is outside the mathf.sqrt

analog dust
#

oh well, derp, that doesn't change anything though

sullen plover
#

but u still havent guessed xD

#

😂

#

cmon

analog dust
#

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.

sullen plover
#

the quadratic formula

analog dust
#

I forget what this is used for lol

#

but alright, I should probably have recognized that, if I was any versed in math :P

sullen plover
analog dust
#

One pro tip for math

#

Use Spreadsheets

sullen plover
#

like excel?

analog dust
#

Learning math without using spreadsheets is torture

#

Yes

#

I use Google Sheets

sullen plover
#

how do spreadsheets help?

analog dust
#

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

sullen plover
#

i can barely use them xd

analog dust
#

and look through your math formulas in steps

sullen plover
#

oh shit

#

thats a good idea

#

i gotta try that next time

#

might take me a day instead of 3

analog dust
#

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.

sullen plover
#

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

analog dust
#

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

sullen plover
#

what if some one made a program for making formulas

#

into code

#

theres an idea

analog dust
#

it made me realize I needed index = index + index; for data and index = index + index + 1; for values

sullen plover
#

pain?

analog dust
#

Yes. I am making a class to handle a single string as a container of 2D data

sullen plover
#

uhhh no clue what that is lmao

analog dust
#

without using any libraries

sullen plover
#

oh shit

analog dust
#

holiday fun

sullen plover
#

wait so string to vector2?

analog dust
#

what?

sullen plover
#

2d data is a vector2 no?

analog dust
#

I have actually not tried them yet

sullen plover
#

oh

#

that reminds me

analog dust
sullen plover
#

this is v1

#

the shittiest program ever

#

like i cant belive i made something this bad

sullen plover
analog dust
sullen plover
#

it looped thru the x values with for loops

#

totaling over 2k loops

analog dust
sullen plover
#

wtf no way

#

thats awesome

#

u gotta show me how u do it sometime

analog dust
#

SetData is a work in progress

sullen plover
#

what is $ in cs?

analog dust
#

$"This is a string which can output {variableName} to the string, without combining multiple strings"

sullen plover
#

oohhhh

analog dust
#
string = @"This one includes
line breaks and white spaces


."
#

they can be combined

sullen plover
#

now i know

#

anyway i really have to sleep now

#

its 6 am for me

analog dust
#

Good night, and good luck o/

sullen plover
#

thanks and good lcuk with ur project