C# 7.0 Unity game development issue, identifier from 4.0 does not work anymore
I'm working on a C#7.0 coding project for Unity3D, and am building a script for doors. This comes directly from a project in the book Unity3.X Game Development Essentials which was recommended to me by a gaming professor. I'm learning code on my own, so I'm at the mercy of any updates. For some reason, the code expects an identifier but I'm unsure what identifier it could possibly want. On a level of skill with coding, I'm right above a snail without a shell, so any advice would be greatly appreciated. At one point in time, this code clearly worked because it was published in a book and was recommended by advanced members of staff. I think the code has been updated though. Any thoughts? Any advice? Thanks so much!
A screen shot of the issue in Visual Studio
c# visual-studio unity3d undeclared-identifier
add a comment |
I'm working on a C#7.0 coding project for Unity3D, and am building a script for doors. This comes directly from a project in the book Unity3.X Game Development Essentials which was recommended to me by a gaming professor. I'm learning code on my own, so I'm at the mercy of any updates. For some reason, the code expects an identifier but I'm unsure what identifier it could possibly want. On a level of skill with coding, I'm right above a snail without a shell, so any advice would be greatly appreciated. At one point in time, this code clearly worked because it was published in a book and was recommended by advanced members of staff. I think the code has been updated though. Any thoughts? Any advice? Thanks so much!
A screen shot of the issue in Visual Studio
c# visual-studio unity3d undeclared-identifier
1
It looks to me like the code in the screenshot is an assignment and you're supposed to fill in the blanks to make the code work. The clues are in the code for you to fix
– Wayne Phipps
Nov 26 '18 at 21:21
2
Post your code not screenshot of it. If you have an error, post the error too. The screenshot shows that theDoor
function is missing variable names for its parameters. It should bepublic void Door(AudioClip doorOpenSound, bool openCheck, string animName)
notpublic void Door(AudioClip, bool, string animName)
. Notice how the AudioClip and bool variable names are missing.....
– Programmer
Nov 26 '18 at 21:24
Yes!!! Thank you so so so much to both of you. I really appreciate all the help I can get. <3 Now I see where I went wrong. I will make sure to watch out for this in future. You guys are the best!!!
– L. Dostal
Nov 26 '18 at 21:30
add a comment |
I'm working on a C#7.0 coding project for Unity3D, and am building a script for doors. This comes directly from a project in the book Unity3.X Game Development Essentials which was recommended to me by a gaming professor. I'm learning code on my own, so I'm at the mercy of any updates. For some reason, the code expects an identifier but I'm unsure what identifier it could possibly want. On a level of skill with coding, I'm right above a snail without a shell, so any advice would be greatly appreciated. At one point in time, this code clearly worked because it was published in a book and was recommended by advanced members of staff. I think the code has been updated though. Any thoughts? Any advice? Thanks so much!
A screen shot of the issue in Visual Studio
c# visual-studio unity3d undeclared-identifier
I'm working on a C#7.0 coding project for Unity3D, and am building a script for doors. This comes directly from a project in the book Unity3.X Game Development Essentials which was recommended to me by a gaming professor. I'm learning code on my own, so I'm at the mercy of any updates. For some reason, the code expects an identifier but I'm unsure what identifier it could possibly want. On a level of skill with coding, I'm right above a snail without a shell, so any advice would be greatly appreciated. At one point in time, this code clearly worked because it was published in a book and was recommended by advanced members of staff. I think the code has been updated though. Any thoughts? Any advice? Thanks so much!
A screen shot of the issue in Visual Studio
c# visual-studio unity3d undeclared-identifier
c# visual-studio unity3d undeclared-identifier
asked Nov 26 '18 at 21:16
L. DostalL. Dostal
484
484
1
It looks to me like the code in the screenshot is an assignment and you're supposed to fill in the blanks to make the code work. The clues are in the code for you to fix
– Wayne Phipps
Nov 26 '18 at 21:21
2
Post your code not screenshot of it. If you have an error, post the error too. The screenshot shows that theDoor
function is missing variable names for its parameters. It should bepublic void Door(AudioClip doorOpenSound, bool openCheck, string animName)
notpublic void Door(AudioClip, bool, string animName)
. Notice how the AudioClip and bool variable names are missing.....
– Programmer
Nov 26 '18 at 21:24
Yes!!! Thank you so so so much to both of you. I really appreciate all the help I can get. <3 Now I see where I went wrong. I will make sure to watch out for this in future. You guys are the best!!!
– L. Dostal
Nov 26 '18 at 21:30
add a comment |
1
It looks to me like the code in the screenshot is an assignment and you're supposed to fill in the blanks to make the code work. The clues are in the code for you to fix
– Wayne Phipps
Nov 26 '18 at 21:21
2
Post your code not screenshot of it. If you have an error, post the error too. The screenshot shows that theDoor
function is missing variable names for its parameters. It should bepublic void Door(AudioClip doorOpenSound, bool openCheck, string animName)
notpublic void Door(AudioClip, bool, string animName)
. Notice how the AudioClip and bool variable names are missing.....
– Programmer
Nov 26 '18 at 21:24
Yes!!! Thank you so so so much to both of you. I really appreciate all the help I can get. <3 Now I see where I went wrong. I will make sure to watch out for this in future. You guys are the best!!!
– L. Dostal
Nov 26 '18 at 21:30
1
1
It looks to me like the code in the screenshot is an assignment and you're supposed to fill in the blanks to make the code work. The clues are in the code for you to fix
– Wayne Phipps
Nov 26 '18 at 21:21
It looks to me like the code in the screenshot is an assignment and you're supposed to fill in the blanks to make the code work. The clues are in the code for you to fix
– Wayne Phipps
Nov 26 '18 at 21:21
2
2
Post your code not screenshot of it. If you have an error, post the error too. The screenshot shows that the
Door
function is missing variable names for its parameters. It should be public void Door(AudioClip doorOpenSound, bool openCheck, string animName)
not public void Door(AudioClip, bool, string animName)
. Notice how the AudioClip and bool variable names are missing.....– Programmer
Nov 26 '18 at 21:24
Post your code not screenshot of it. If you have an error, post the error too. The screenshot shows that the
Door
function is missing variable names for its parameters. It should be public void Door(AudioClip doorOpenSound, bool openCheck, string animName)
not public void Door(AudioClip, bool, string animName)
. Notice how the AudioClip and bool variable names are missing.....– Programmer
Nov 26 '18 at 21:24
Yes!!! Thank you so so so much to both of you. I really appreciate all the help I can get. <3 Now I see where I went wrong. I will make sure to watch out for this in future. You guys are the best!!!
– L. Dostal
Nov 26 '18 at 21:30
Yes!!! Thank you so so so much to both of you. I really appreciate all the help I can get. <3 Now I see where I went wrong. I will make sure to watch out for this in future. You guys are the best!!!
– L. Dostal
Nov 26 '18 at 21:30
add a comment |
1 Answer
1
active
oldest
votes
Well, the problem is at a line which defines your method Door
.
A method may take input parameters from its caller. Those parameters are variables, available from within the method. Variables are pointers to a memory and their primary goal is to keep information. A variable in C# must always have a type, without a type, variable is meaningless. For example, your variable may be a string (and contain things like "word", "sentence with multiple words" and so on), or integer (1, 5, 1000, -256 and so on), and many many other types.
Your method definition, I believe, is supposed to have three parameters. In C#, when defining a parameter (or a variable), you first write its type, and then its name. Like this: string someVar
, or this: int someOtherVar
.
In your case, you're missing those names. Your method definition containts only types, separated by comma, but no names. Name your parameters and the compilation errors will disappear.
For example, like this:
public void Door(AudioClip doorOpenSound, bool openCheck, string animName)
Thank you so much! I'm almost in tears I'm so happy. I felt like the problem was staring me in the face for ages, and now I see where I went wrong. You are the best of the best! <3
– L. Dostal
Nov 26 '18 at 21:31
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53489199%2fc-sharp-7-0-unity-game-development-issue-identifier-from-4-0-does-not-work-anym%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Well, the problem is at a line which defines your method Door
.
A method may take input parameters from its caller. Those parameters are variables, available from within the method. Variables are pointers to a memory and their primary goal is to keep information. A variable in C# must always have a type, without a type, variable is meaningless. For example, your variable may be a string (and contain things like "word", "sentence with multiple words" and so on), or integer (1, 5, 1000, -256 and so on), and many many other types.
Your method definition, I believe, is supposed to have three parameters. In C#, when defining a parameter (or a variable), you first write its type, and then its name. Like this: string someVar
, or this: int someOtherVar
.
In your case, you're missing those names. Your method definition containts only types, separated by comma, but no names. Name your parameters and the compilation errors will disappear.
For example, like this:
public void Door(AudioClip doorOpenSound, bool openCheck, string animName)
Thank you so much! I'm almost in tears I'm so happy. I felt like the problem was staring me in the face for ages, and now I see where I went wrong. You are the best of the best! <3
– L. Dostal
Nov 26 '18 at 21:31
add a comment |
Well, the problem is at a line which defines your method Door
.
A method may take input parameters from its caller. Those parameters are variables, available from within the method. Variables are pointers to a memory and their primary goal is to keep information. A variable in C# must always have a type, without a type, variable is meaningless. For example, your variable may be a string (and contain things like "word", "sentence with multiple words" and so on), or integer (1, 5, 1000, -256 and so on), and many many other types.
Your method definition, I believe, is supposed to have three parameters. In C#, when defining a parameter (or a variable), you first write its type, and then its name. Like this: string someVar
, or this: int someOtherVar
.
In your case, you're missing those names. Your method definition containts only types, separated by comma, but no names. Name your parameters and the compilation errors will disappear.
For example, like this:
public void Door(AudioClip doorOpenSound, bool openCheck, string animName)
Thank you so much! I'm almost in tears I'm so happy. I felt like the problem was staring me in the face for ages, and now I see where I went wrong. You are the best of the best! <3
– L. Dostal
Nov 26 '18 at 21:31
add a comment |
Well, the problem is at a line which defines your method Door
.
A method may take input parameters from its caller. Those parameters are variables, available from within the method. Variables are pointers to a memory and their primary goal is to keep information. A variable in C# must always have a type, without a type, variable is meaningless. For example, your variable may be a string (and contain things like "word", "sentence with multiple words" and so on), or integer (1, 5, 1000, -256 and so on), and many many other types.
Your method definition, I believe, is supposed to have three parameters. In C#, when defining a parameter (or a variable), you first write its type, and then its name. Like this: string someVar
, or this: int someOtherVar
.
In your case, you're missing those names. Your method definition containts only types, separated by comma, but no names. Name your parameters and the compilation errors will disappear.
For example, like this:
public void Door(AudioClip doorOpenSound, bool openCheck, string animName)
Well, the problem is at a line which defines your method Door
.
A method may take input parameters from its caller. Those parameters are variables, available from within the method. Variables are pointers to a memory and their primary goal is to keep information. A variable in C# must always have a type, without a type, variable is meaningless. For example, your variable may be a string (and contain things like "word", "sentence with multiple words" and so on), or integer (1, 5, 1000, -256 and so on), and many many other types.
Your method definition, I believe, is supposed to have three parameters. In C#, when defining a parameter (or a variable), you first write its type, and then its name. Like this: string someVar
, or this: int someOtherVar
.
In your case, you're missing those names. Your method definition containts only types, separated by comma, but no names. Name your parameters and the compilation errors will disappear.
For example, like this:
public void Door(AudioClip doorOpenSound, bool openCheck, string animName)
answered Nov 26 '18 at 21:24
AgentFireAgentFire
5,76263272
5,76263272
Thank you so much! I'm almost in tears I'm so happy. I felt like the problem was staring me in the face for ages, and now I see where I went wrong. You are the best of the best! <3
– L. Dostal
Nov 26 '18 at 21:31
add a comment |
Thank you so much! I'm almost in tears I'm so happy. I felt like the problem was staring me in the face for ages, and now I see where I went wrong. You are the best of the best! <3
– L. Dostal
Nov 26 '18 at 21:31
Thank you so much! I'm almost in tears I'm so happy. I felt like the problem was staring me in the face for ages, and now I see where I went wrong. You are the best of the best! <3
– L. Dostal
Nov 26 '18 at 21:31
Thank you so much! I'm almost in tears I'm so happy. I felt like the problem was staring me in the face for ages, and now I see where I went wrong. You are the best of the best! <3
– L. Dostal
Nov 26 '18 at 21:31
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53489199%2fc-sharp-7-0-unity-game-development-issue-identifier-from-4-0-does-not-work-anym%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
It looks to me like the code in the screenshot is an assignment and you're supposed to fill in the blanks to make the code work. The clues are in the code for you to fix
– Wayne Phipps
Nov 26 '18 at 21:21
2
Post your code not screenshot of it. If you have an error, post the error too. The screenshot shows that the
Door
function is missing variable names for its parameters. It should bepublic void Door(AudioClip doorOpenSound, bool openCheck, string animName)
notpublic void Door(AudioClip, bool, string animName)
. Notice how the AudioClip and bool variable names are missing.....– Programmer
Nov 26 '18 at 21:24
Yes!!! Thank you so so so much to both of you. I really appreciate all the help I can get. <3 Now I see where I went wrong. I will make sure to watch out for this in future. You guys are the best!!!
– L. Dostal
Nov 26 '18 at 21:30