How would we know what’s wrong with it? We don’t even know what it being correct would look like because you didn’t explain it so you need to post some information. Sure, we can guess but we shouldn’t have to.
I’ll move your post to the Scripting forum though where general scripting questions should go.
I’m sure you do, you’ve got lots of typos and just plain wrong C#. You didn’t acknowledge the errors I mentioned, just came and posted about some other error. Did you fix them? Help is about communicating both ways, not just posting new errors.
MelvMay, I was the same when I started C#, I didn’t know my arse from my elbow and didn’t know what to ask, I’m glad I didn’t get the same welcome he got.
I understood him clearly and didn’t feel the need to go through the usual programmer’s protocol to get an answer to his question.
Asking for more information and asking to acknowlede what has been fixed is a simple communication thing. I’m glad you knew exactly what all the problems were, not all will. This is why we ask and highlight to devs, especially when they begin here, to spend a little more time clearly communicating the errors such as actually stating the errors being reported and what they’ve fixed based upon feedback.
We deal with many of these posts each and every day.
I have a feeling this is another classic case of Visual Studio not being properly “paired” with Unity, because Intellisense would help avoid most of these errors (like float being misspelled “flaot”). There should also be red squiggly lines galore, making it trivial to track down where most of the typos/errors are.
To the OP:
In Unity, make sure you go to Edit->Preferences->External Tools and change “External Script Editor” to your version of Visual Studio (that is, of course, assuming you aren’t using some other IDE).
If you aren’t seeing red squiggly lines all throughout your script (particularly where the typos are), you absolutely should be!
I feel you guys on these forums are too cold. I mean you expect everyone to know exactly what they are talking about and know how to explain it. I mean sure… They should at least say what they expect the script to do but you can’t expect everyone who uses Unity to be an expert. I consider myself to be pretty decent with Unity but not an expert. There are some things I can’t even explain to you guys very well. I mean I know what I want the code to do but translating that into readable English is hard for me to do as well as many others. It seems like more than helping what you guys do is try to correct the OP’s behavior. That’s not what they came here for. And then when a guy comes here, clearly explains his issue, and includes the code nobody is there to help if it’s even a little bit complex. And by complex I mean the answer isn’t easily available on Google. Because for a lot of Unity users like myself we look on google first. Heck I dread posting anything here. It’s almost as if I’m ruining your guys day by asking for help. At least that’s the kind of welcome I get.
Now … given that, how do you propose to explain what you want to the computer?
This is why we ask you process questions, encourage you to troubleshoot, learn the terminology, and we try to get you to actually improve your ability to explain what you want.
It’s not because we’re “cold” (whatever that means) but rather because we don’t want to sit here going around and around with somebody who cannot explain and refuses to learn how to explain.
Well the reason they’re asking for help is because they don’t know how to code it. They don’t understand what they have to do. How can they explain something they don’t understand? They can tell you what they want. But how is a person supposed to explain something they don’t understand how to do?
Yes, the first I looked at was closed: “Closed for being lazy and argumentative.”
You seem to be making a case that the amount coding knowledge is the problem. What was highlighted above is a problem with communication of a problem. This is something that has nothing to do with programming or knowledge of Unity.
An analogy if you will: You go to your doctor and say, “My body isn’t working, what’s wrong?” The doctor will tell you that there’s no way they could give you a solution to your problem without further information. Rather than elaborating on the original issue you then say, also my friend has a problem, what’s wrong? The doctor might say, “well you look pale but you need to ellaborate”. Is what the doctor said “BS”? No. Do you need to be trained as a doctor to explain your symptoms clearly? No. At any time did the doctor say, “oh come on, can you please explain your symptoms in technical medical terms?” No.
This kind of poor communication of a problem happens all the time here so all we can do when faced with it is to highlight the communication issue itself (your so-called BS) and that more information is needed to help further.
You pushing your story as if someone is criticising not understanding Unity, isn’t real and is not the case at all. It’s about good communication of a problem or problems.
With all that said above, I’m sorry if you feel how you do. If you communicate clearly on the problem, I’d personally spend a lot of time helping you. This isn’t my day job at Unity, I’m here because I enjoy it when I solve problems.
I will add that a lot of Unity devs just stay away from the forums because it’s super hard work to help people who don’t want to put effort in and eventually you just end up in the middle of threads like that. Lots of devs then just stay away permanently. Personally I stick with it because for all the difficulties, the people I’m helping are real and are struggling and maybe the knowledge in my head might help. I’ve been on the other end of that. The problem is always, understanding what the problem is.
Learning to code can be frustrating and may take up to 4 or 5 years without school education before it is not at all frustrating.
Following YouTube Tutorials is particularly frustrating because often the tutorial writer leaves out vital or important aspects to surprise the coder and create a dependence on their channel and expand their number of comments and interactions. While a forum user generally receives nothing for their help. But is expected to provide the resolution by reading through some YouTubers BS code.
unless the mistake is glaringly obvious the lesson you should learn is to stop following that persons tutorials. Because copy and pasting other peoples code is a waste of time unless you actually understand the purpose of the presence of the code. And generally speaking how often does the tutorial writer tell you the purpose of the presence of the code.
Best advice I can give is to code something simpler. Move a cube around: and make a basic AI using a rigidbody, add force, random range a float, vector forward, vector Right, vector up, -vector right, -vector forward -vector up and you’ll be on your way to enlightenment in no time. And you won’t be frustrated.
unity documentation on available and provided functions will teach you everything you need to know about how to go about intelligently controlling an object.