C# 7.0 Unity game development issue, identifier from 4.0 does not work anymore












2















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










share|improve this question


















  • 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 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
















2















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










share|improve this question


















  • 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 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














2












2








2








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










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 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














  • 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 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








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












1 Answer
1






active

oldest

votes


















1














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)





share|improve this answer
























  • 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











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
});


}
});














draft saved

draft discarded


















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









1














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)





share|improve this answer
























  • 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
















1














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)





share|improve this answer
























  • 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














1












1








1







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)





share|improve this answer













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)






share|improve this answer












share|improve this answer



share|improve this answer










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



















  • 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




















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks