I have Been making water physics and seems to making a weird mistake its say this:Assets/Scripts/Water Physics.js(13,71): BCE0023: No appropriate version of ‘UnityEngine.Transform.TransformDirection’ for the argument list ‘(float)’ was found. as you can tell its a line 13 even though the argument float is on the line below it line 14 so im confuse of what the error actully its also JavaScript so is it the transform.transform direction or the float?
By float i think the variable name
my code is:
//deathnadosharkgames
var waterLevel : float;
var floatHeight : float;
var bouncedamp : float;
var offtheset : float;
private var forcefactor : float;
private var actionpoint : Vector3;
private var uplift : Vector3;
function Update () {
actionpoint = transform.postion + transform.TransformDirection(offtheset);
forcefactor = 1f - ((actionpoint.y - waterLevel) / floatHeight);
if(forcefactor > 0f) {
uplift = -Physics.gravity *(forcefactor - rigidbody.velocity.y * bouncedamp);
rigidbody.AddForceAtPosition(uplift, actionpoint);
}
}