❔ c# unity error
in unity i am getting this error here:
the full code is here: https://pastebin.com/KzChaicv, line 35.
can someone please help me?
91 Replies
Are you using a Unity version from 2005? /s
i am using the version 2017.3
Why?
Just install Unity 2021
and you should be good
I mean, theberrorbis pretty clear: you're using a language feature that's not supported in C#6
the project was made with this version
either don't use that, or changenyour C# version
how
i am new to c# sorry.
so how am i able to fix that ?
what line is the error?
35
yeah
its the
out
thingchange that line to be valid syntax for C#6, or lookup how to change C# versioning under Unity
ok thx bro
this one here
?
just replace the
var
with the type
thats your issue. C#7 implemented using var
with out
you cannot change the C# version without upgrading the editor versionYou can also convert a project to a newer Unity version
how to replace it with type
sorry for asking
what is
states
dictionary(?) of whatok then the type is
State<T, K>
try putting that instead of the var
ok
like this?
whats the error saying?
well i gotta translate it because its german
oh it might be this:
ok let me try
YES IT WORKED
THANK YOU SO MUCH BRO
also i hope its okay if you also help me with this
the error says:
full code:
Pastebin
```using SBS.Math;using UnityEngine;namespace SBS.Core{ public c...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
line 45
you havent got two TimeSource classes in different namespaces?
I can only think that the TimeSource in the TimeManager is using a different type and not the SBS.Core.TimeSource
Let me see If i have two
thats the only namespace there
any idea how to fix the error?
this error here i mean
does the error show in the Unity console?
no
only in visual studio
restart visual studio
ok
nope
i am still getting the error
but the error doesn't appear in unity
If you can enter play mode then I've got no idea why VS is saying its wrong
let me try
now i am getting the error in unity
Honestly cannot see whats wrong with that
try restarting Unity
yea i know why the error appears
i have another script called
FSM
and there is another error
with the timeSource
this one hereand this one here
this one here is the in the timeSource script
and this one here is in the FSM script
so thats the
TimeSource
script: https://pastebin.com/YjvBDp1j
and this one here the FSM
script: https://pastebin.com/iwk9jdu4Pastebin
```using SBS.Math;using UnityEngine;namespace SBS.Core{ public c...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
using System.Collections.Generic;namespace SBS.Core{ public clas...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
the timeSource script error is in line 44 and FSM script error in line 61
maybe thats the problem
idk
or nah
nah
its not that
i was wrong
i still don't know why i get that error
@ThatDaniel
that thing with ==
does it require something called
operator overloads
?
uh i got again the error herethe
out
thingany idea how to fix that?
What does the error say?
like this
Declare the variable before the if statement
ok let me try
out value
sorryno worries
now its working
thx
uh talking about the ref
what can i do there to get that error fixed?
What are you trying to do?
in the script there are two errors
the
ref
yes, so remove it
thats it?
Are you trying to mod a game?
no i decompiled a script from a game
Which game is that?
Motorway-Mayhem
so now that i removed the ref things
in unity i am getting this here
You don't need ref for that
$refvsvalue
Which you should use when passing to methods - if needed
ok 👍
also if you don't mind me asking this
in unity
how do i know which script goes where
nvm nvm
got it
sup guys
i hope you all have a great day
i hope you guys don't mind helping me out a little bit
Pastebin
using System.Collections.Generic;using SBS.Core;using SBS.Math;usin...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
its this error here
line 28
well i got that fixed
got another error
line 93
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.