❔ very easy problem probably I just started

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

Did you find this page helpful?