Why is scripting so hard why cant if you wanted a character to move forward and play a walk animation you just write something like when w is pressed character moves forward and plays walk animation!!!!! instead of writing about 4 paragraphs that dosent make scense!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4 Answers
4var Speed = 5.0;
function Update ()
{
if(Input.GetKey("w"))
{
transform.Translate(transform.forward * Speed * Time.deltaTime);
animation.Play(Name of animation);
}
}
Or something along thoes lines. Really scripting is really not that hard, or atleast the basic of it is not. Just keep trying.
OrangeLightning posted exactly what you said, and it was 6 lines of code. Mind you, you can also write it like this:
var Speed = 5.0; if(Input.GetKey("w")){transform.Translate(transform.forward * Speed * Time.deltaTime); animation.Play(Name of animation);}
and it'll still work. It depends how you format it, although, if you post on here, make sure it's formated half way decently.
In other words, it can be long, or it can be short... I have 2 ways to format for school, and for one of my projects, my lines of code went from 380 to like, 596, so it really depends on how you want to do it.
As to why it's hard. It really isn't hard. Going off the fact that it's pretty much teaching a baby or dog how to do something, they do what you want it to do and nothing else. You have to be detailed, and you have to guide it, but ultimately, they'll do what you want them to do. Also, the fact that you have the Unity Scripting API, it makes it about 20000 times easier, unlike C, where their really isn't a solid API. So you should be thankful if anything.
But good luck, and I recommend analyzing scripts, not just copy pasting.
Good luck again!
Yeah, it is basicly like learning to ride a bike. Once you learned it you never forget it... hopefully :)
– FLASHDENMARKYou could also code visually with Antares VIZIO extension for Unity3D.
At least you dont have to write 4 paragrahps that doesn't make sense. I haven't tried this personally but kismet diagrams are pretty straight forward to use. Just connect some "cables" :)
– StatementIt depends greatly :) But I've seen my fair share of "real spaghetti code" and I know enough to stay out of that realm as much as I can. My strength is in my source.
– StatementSome of the spaghetti code: http://db.tt/x4kbrfR I had to resume another developers work and I had no one there to really guide me through it all. It was a real mess and I am not dying to get into that business again. Lines were overlapping so it was impossible to see what was going on.
– StatementWe are actually pretty spoilt with Unity and its scripting engine. DirectX and game programmers of other frameworks back in the day really had to know their 3D theory and math equations to be effective at what they do.
Unity really does make it as simple as possible. You need those lines of code because you need to tell the computer specifically what you want.
Once you start getting the hang of it you'll enjoy it more and won't be so frustrated :-)
this isn't really a question that belongs here. Bt i guess its the same as saying "why is japanese so hard why can't I just say hi and they will say hello back" the answer is that (unless they have learnt english) they won't understand you. The Computer doesn't understand english you'd prefer to speak to it in english it would prefer to speak in 0 and 1 but thats not very useful so some one has made a way for us to comprehend (with practice) what the computer is saying
– ScribeBecause programmers generally have good salary.
– Statementthnx for every ones coments i was just in an angry mood about scripting but i kinda get why its so hard thanks again.
– anon34742945