Quantcast
Channel: Answers by "Graham-Dunnett"
Viewing all articles
Browse latest Browse all 959

Answer by Graham Dunnett

$
0
0
You have a gazillion problems. I've editted your script and added some comments. Maybe watch some of the scripting tutorials on the Learn site. A common mistake is you do not write if statements correctly: if (condition){ // code it execute if the condition is matched } Note the opening brace following the condition, and the closing brace that is aligned with the if. This makes the code readable. You can also use: if (condition) { // code it execute if the condition is matched } I personally think opening braces on a line all by themselves makes the code longer. Also every opening brace has a matching closing brace. Functions start and stop with them: function doit() { // code for the function } Note that all of this is general programming lessons, it's totally unrelated to Unity.

Viewing all articles
Browse latest Browse all 959

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>