When I put my script in and save it, Unity gives me an error.
“Assets/FlightScript.cs(7,18): error CS1525: Unexpected symbol ‘public’”
And
“Assets/FlightScript.cs(9,10): error CS1525: Unexpected symbol ‘public’”
Here’s the code. VVV
using UnityEngine;
using System.Collections;
public class FlightScript : MonoBehaviour {
void Start () {
public float AmbientSpeed = 100.0f;
public float RotationSpeed = 200.0f;
}
void UpdateFunction() {
Quaternion AddRot = Quaternion.identity;
float roll = 0;
float pitch = 0;
float yaw = 0;
roll = Input.GetAxis("Roll") * (Time.deltaTime * RotationSpeed);
pitch = Input.GetAxis("Pitch") * (Time.deltaTime * RotationSpeed);
yaw = Input.GetAxis("Yaw") * (Time.deltaTime * RotationSpeed);
AddRot.eulerAngles = new Vector3(-pitch, yaw, -roll);
rigidbody.rotation *= AddRot;
Vector3 AddPos = Vector3.forward;
AddPos = Ship.rigidbody.rotation * AddPos;
rigidbody.velocity = AddPos * (Time.deltaTime * AmbientSpeed);
}
}
(IT IS A C# CODE, NOT JAVA)