BCE0031: Language feature not implemented: Ambiguous(Void AddRelativeForce(Vector3, ForceMode), Void AddRelativeForce(Vector3), Void AddRelativeForce(Single, Single, Single), Void AddRelativeForce(Single, Single, Single, ForceMode)).
hey I'm pretty new to unity and javascript and all I want to do is apply force on its local y axis for a helicopter and I keep getting the same error over and over please help
error : Assets/heli.js(42,34): BCE0031: Language feature not implemented: Ambiguous(Void AddRelativeForce(Vector3, ForceMode), Void AddRelativeForce(Vector3), Void AddRelativeForce(Single, Single, Single), Void AddRelativeForce(Single, Single, Single, ForceMode)).
the variables :
var rotor : Vector3;
var rb : Rigidbody;
var rpm : float;
var maxrpm : float;
var minrpm : float;
var pitchtorque : float;
var rolltorque : float;
var collective : float;
var maxcollective : float;
var mincollective : float;
var enginepow : float;
var health : float;
var enginestate : boolean;
var engine : boolean;
var bladedrag : float;
var lift : float;
the code with the error:
if (rpm > 10) {
this.rb.AddRelativeForce = (transform.forward * lift);
}
Answer by Landern · Aug 19, 2016 at 06:12 PM
AddRelativeForce is not a field or a property, it is infact a method thus it CAN take parameters/arguments between paratheisis. Change your code to the following(remove the equals sign):
if (rpm > 10) {
this.rb.AddRelativeForce(transform.forward * lift);
}
Your answer
Follow this Question
Related Questions
Having a OnTriggerEnter make another gameobject Add Force in UnityScript. 1 Answer
how to modify another objects kinematic state? 0 Answers
'OpenClose' is not a member of 'Pushpull' Javascript help 0 Answers
A script that doesn't allow moving objects to go through non-moving objects? 1 Answer
rigidbody.Addforce stacking? 2 Answers