C
C#15mo ago
tromboner123

❔ very easy problem probably I just started

How do i save a vector 3 value when i reopen unity
31 Replies
Jimmacle
Jimmacle15mo ago
you can use if statements to compare the value with 0.7 and only add to it if it meets that condition
tromboner123
tromboner123OP15mo ago
That gives errors
Jimmacle
Jimmacle15mo ago
okay, which errors?
tromboner123
tromboner123OP15mo ago
Idk just red line under it
SinFluxx
SinFluxx15mo ago
So check it to see what it says?
TheRanger
TheRanger15mo ago
hover ur mouse on it, u will see what error
Jimmacle
Jimmacle15mo ago
or look in the error box at the bottom of your IDE
TheRanger
TheRanger15mo ago
it will also help if you showed us that code part
tromboner123
tromboner123OP15mo ago
now it doesnt show any error anymore
No description
tromboner123
tromboner123OP15mo ago
is this correct
TheRanger
TheRanger15mo ago
where is the vector3.y ur talking about?
tromboner123
tromboner123OP15mo ago
uh i kinda explained it wrong lol i meant localscale.x oopsie
TheRanger
TheRanger15mo ago
you want to check if it's negative or bigger than 0.7 right?
tromboner123
tromboner123OP15mo ago
i will do the 0.7 thingy in other if function i think so if u press s it gets smaller
TheRanger
TheRanger15mo ago
ur if condition checks if its bigger than 0 atm
tromboner123
tromboner123OP15mo ago
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?
TheRanger
TheRanger15mo ago
well it doesnt check if its negative so no
tromboner123
tromboner123OP15mo ago
i mean bigger than 0 or negative is the same rihgt
TheRanger
TheRanger15mo ago
no
tromboner123
tromboner123OP15mo ago
i mean bigger than 0 or not negative i want the value to stay positive
TheRanger
TheRanger15mo ago
yes, but 0 is also a positive number
tromboner123
tromboner123OP15mo ago
yes so i did > 0 that means not equal or higher than 0 right
TheRanger
TheRanger15mo ago
>0 means higher than 0 if the value itself is 0, the if condition will return false
tromboner123
tromboner123OP15mo ago
ooh ofc but it wont get negative in any way right
TheRanger
TheRanger15mo ago
if its 0 or less than 0 (a negative) number, the if condition will return false yes
tromboner123
tromboner123OP15mo ago
then it should be good so then idk why it isnt working
TheRanger
TheRanger15mo ago
debug and find out
tromboner123
tromboner123OP15mo ago
omg im so dumb sorry for having negative braincells apperently if you close unity ur values reset
tromboner123
tromboner123OP15mo ago
No description
tromboner123
tromboner123OP15mo ago
this
Accord
Accord15mo ago
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.
Want results from more Discord servers?
Add your server