Hey all,
I’m having a hard time using C# the way I thought it works, I was hoping someone could steer me in the right direction on this one.
This is a basic script to define a couple variables then utilize those variables.
using UnityEngine;
using System.Collections;
public class CharacterMovement : MonoBehaviour {
public int vertSpeed = 0.20;
public int rotateSpeed = 0.20;
you should watch all the scripting videos once a month for a year. it will make you way way way smarter. I still go back to them from time to time years later. not patronizing. Gametyme is right. There are things you will -not- understand right now you will two months from now, and so on.
and int cannot have a decimal. it is a solid number.
a float is a floating point value, and can have decimals
you want declare
float rotateSpeed = 0.2f;
if you don’t add the f it will be treated as a double and will not work.
read the tutorials. watch the videos. you will save yourself way more time than if you don’t, even if they seem time consuming.
I suggest you, to learn the C# basics. There are ton of online open books. “If “int” isn’t the right class”, That are variables which saving your datas in memory at runtime. ^^