Hi everyone. Im really new to all this, and decided i would try and learn some 2d stuff before i tackle 3d. My one big hang up is i cant stand using tutorials that show you how to use their scripts and make things work. The bottom line is you really dont get to learn every thing involved by just grabbing anothers script and using it. I do have a little experience in c# and a few other scriptin languages, but not alot. So , i decided to write my own scripts and project from complete scratch.
This is where the issue hass arisen, that everywhere i go to learn just shows you how to use pre built assets / scripts to do anything. Not very helpful in assessing the hows /. and whys. That being said , i set up a small demo to work with, where i have a level mesh designed to run back and forth along, and a few areas where i can jump over holes, and onto platforms above the main ground scene. Just like good ole super mario.
Now through research i have found several articles showing me a little about each aspect of the script i need, and at this moment i have this script here in place… what i cant figure out is how and where to set jumping = true or false.
So as you can see, this script is very simple and very easy to understand … as i said , im a complete beginner to unity. So, can anyone help me and show me how i might tie my jumping var into this script so that it will work properly. At the moment, i can jump , and jump again over and over in the air (if i remove jumping completely), or, I can easily set jumping = true, and than you can not jump anymore (as seen as above) .
All help is greatly appreciated , and sorry for being total nubz, but i suppose we are all @ some point
TY!
//// UPDATE ////
Ok, i have managed to take a few other things i have learned about unity and added the following to the script, and i seem to have gotten what i was trying to accomplish. Now my character moves left , right, jumps just fine. But there is one flaw in the way it moves that i can not figure out.
When i jump from a lower ledge to a higher ledge, if my characters body lands against the ledge, but not on it, as long as im pressing forward still, the character sticks to the surface. O.O This just will not do !
Any ideas? Thanks in advance.
My bad , just realised im in the wrong area of the forum :*.