using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DroneMovementScript : MonoBehaviour
{
Rigidbody ourDrone;
void Awake(){
ourDrone = GetComponent();
}
void FixedUpdate()
{
MovementUpDown();
MovementForward();
Rotation();
ourDrone.AddRelativeForce(Vector3.up * upForce);
ourDrone.rotation = Quaternion.Euler(
new Vector3(tiltAmountForward, currentYRotation, ourDrone.rotation.z)
);
}
public float upForce;
void MovementUpDown()
{
if (Input.GetKey(KeyCode.I))
{
upForce = 450;
}
else if (Input.GetKey(KeyCode.K))
{
upForce = -200;
}
else if (!Input.GetKey(KeyCode.I) && !Input.GetKey(KeyCode.K))
{
upForce = 98.1f;
}
}
private float movementForwardSpeed = 500.0f;
private float tiltAmountForward = 0;
private float titltVelocityForward;
void MovementForward()
{
if(Input.GetAxis(“Vertical”) != 0) {
ourDrone.AddRelativeForce(Vector3.forward * Input.GetAxis(“Vertical”) * movementForwardSpeed);
tiltAmountForward = Mathf.SmoothDamp(tiltAmountForward, 20 * Input.GetAxis(“Vertical”), ref titltVelocityForward, 0.1f);
}
}
private float wantedYRotation;
private float currentYRotation;
private float rotateAmoutByKeys = 2.5f;
private float rotationYVelocity;
void Rotation()
{
if (Input.GetKey(KeyCode.J))
{
wantedYRotation -= rotationAmoutByKeys;
}
if (Input.GetKey(KeyCode.K))
{
wantedYRotation += rotationAmoutByKeys;
}
currentYRotation = Mathf.SmoothDamp(currentYRotation, wantedYRotation, res rotationYVelocity, 0.25f);
}
}
My software is giving me this problem when I run this software above: Assets\DroneMovementScript.cs(69,84): error CS1003: Syntax error, ‘,’ expected.
Can you help me?