void Update () {
if(Input.GetKeyDown(KeyCode.Mouse0))
{
var playerPlane = new Plane(Vector3.up, transform.position);
var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
var hitdist = 0.0;
if (playerPlane.Raycast (ray, hitdist)) {
var targetPoint = ray.GetPoint(hitdist);
targetPosition = ray.GetPoint(hitdist);
var targetRotation = Quaternion.LookRotation(targetPoint - transform.position);
transform.rotation = targetRotation;
}
}
transform.position = Vector3.Lerp (transform.position, targetPosition, Time.deltaTime * smooth);
}
So I’ve converted some of this script already, but my knowledge of JavaScript is very minimal. I’d really like to know how to convert this snippet into C#, if someone is able to show me how I’d really appreciate it!
I’ve made those changes, but it’s telling me I don’t need the “out” modifier. Taking that out, my only error is a “Best overloaded match…” error, which I should be able to fix. Thanks for the help!
the enter argument should be with an out, was there a recent change or is the documentation flawed for the C# sample? I wonder because it doenst make sense without the out.