❔ very easy problem probably I just started
How do i save a vector 3 value when i reopen unity
31 Replies
you can use
if
statements to compare the value with 0.7 and only add to it if it meets that conditionThat gives errors
okay, which errors?
Idk just red line under it
So check it to see what it says?
hover ur mouse on it, u will see what error
or look in the error box at the bottom of your IDE
it will also help if you showed us that code part
now it doesnt show any error anymore
is this correct
where is the vector3.y ur talking about?
uh i kinda explained it wrong lol
i meant localscale.x
oopsie
you want to check if it's negative or bigger than 0.7
right?
i will do the 0.7 thingy in other if function i think
so if u press s it gets smaller
ur if condition checks if its bigger than 0 atm
but if its negative it will do weird
so i wnana prevent that if i hold s it gets tinier than 0 cuz it will bug
yes
so its correct?
well it doesnt check if its negative so no
i mean bigger than 0 or negative is the same rihgt
no
i mean bigger than 0 or not negative
i want the value to stay positive
yes, but 0 is also a positive number
yes so i did > 0
that means not equal or higher than 0 right
>0 means higher than 0
if the value itself is 0, the if condition will return false
ooh ofc
but it wont get negative in any way right
if its 0 or less than 0 (a negative) number, the if condition will return false yes
then it should be good
so then idk why it isnt working
debug and find out
omg im so dumb
sorry for having negative braincells
apperently if you close unity ur values reset
this
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.