C
C#9mo ago
tromboner123

❔ very easy problem probably I just started

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