- Home /
Learning scripting in C Sharp.
Hey everyone, I'm quite new to scripting. So I just want to ask a few questions. Just do get the basics SET! Sooo....
public class RANDOM SCRIPT : MonoBehaviour {
public Transform Object;
public int moveSpeed;
public int rotationSpeed;
void Start () {
}
void Update () {
}
}
So... all the public ints, Is that basiclly creating a word? And then you explain the word, but writing the "voids" to the script/game engine. public Transform. Transform, isn't that the object/prefab set in the slot in the inspector? void Start: Isn't that where you set something to run the entire time? void Update: Isn't that where you can, basiclly turn things ON/OFF at all times? Thanks for reading and I hope you understand my questions :)
Answer by Paulo-Henrique025 · Feb 06, 2013 at 07:25 PM
I think you should first get some programming basics, your script has some bad basic programming errors and also you don't seen o know what a class is.
I'm not being rude, just pointing out that you should first undersand what is to program first.
To adress your questions: int is the short for Integer, which is a number, so no words here. It means your moveSpeed and rotationSpeed are number. Just as the INT means you are creating a Number void mean that you are creating nothing, it's void, there is no type associated. void before the Start means that this function does not have a return, when it ends there is no result.
Start happens only once when the Scene starts. Update runs as fast as possible for all objects in your scene, it's not FPS dependent.
Well, I know it has some errors, I just got a random script and removed all the stuff in the Start and Update, just to ask what they mean. And what you use the public int, and so on for :) Thanks for your answer
Your answer
![](https://koobas.hobune.stream/wayback/20220613092245im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Starting out C# help 2 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
OnGui Button not displaying 1 Answer
Footstep Script Not Working 2 Answers