Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Why does my script gives an Error "Operator '*' cannot be used with a left hand side of type 'Object' and a right hand side of type 'float'." testing on Android?

$
0
0
function DoRoll (aPoint, aAxis, aAngle, aDuration) { var tSteps = Mathf.Ceil(aDuration * 30.0); var tAngle = aAngle / tSteps; var pos : Vector3; // declare variable to fix the y position // Rotate the cube by the point, axis and angle for (var i = 1; i <= tSteps; i++) { transform.RotateAround (aPoint, aAxis, tAngle); yield WaitForSeconds(0.0033333); } // move the targetpoint to the center of the cube transform.Find("targetpoint").position = transform.position; // Make sure the y position is correct pos = transform.position; pos.y = startY; transform.position = pos; // Make sure the angles are snaping to 90 degrees. var vec = transform.eulerAngles; vec.x = Mathf.Round(vec.x / 90) * 90; vec.y = Mathf.Round(vec.y / 90) * 90; vec.z = Mathf.Round(vec.z / 90) * 90; transform.eulerAngles = vec; // The cube is stoped ismoving = false; } **How to fix this error? Is it possible? Oh, and an Error is in line 3 (place where is written "var tSteps = ...")**

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>