i get an parsing error on this:
using UnityEngine;
using System.Collections;
public class MoveForwardwithMouseClick : MonoBehaviour {
void FixedUpdate() {
if (Input.GetAxis("Fire1")) {
rigidbody.AddForce(transform.forward * rigidbody.velocity * 2f);
}
}
Assets/Scripts/MoveForwardwithMouseClick.cs(11,1): error CS8025: Parsing error
i want to thurst a rigidbody forward to it's z-axis with an upwarding speed by pressing the left mouse button.
I closed the lines and get now other errors:
public class MoveForwardwithMouseClick : MonoBehaviour {
void FixedUpdate() {
if (Input.GetAxis("Fire1")) {
rigidbody.AddForce(transform.forward * rigidbody.velocity * 2f);
}
}
}
error CS0029: Cannot implicitly convert type `float' to`bool'
error CS0019: Operator `*' cannot be applied to operands of type`UnityEngine.Vector3' and `UnityEngine.Vector3'
O_O