Quantcast
Channel: Questions in topic: "obj"
Viewing all articles
Browse latest Browse all 167

how to do action with move

$
0
0
![alt text][1] [1]: /storage/temp/19492-screen+shot+2013-12-18+at+11.48.22+am.png I downloaded free model from website. And place it in unity3d scene view. I got code for move. But how to stop the movement some distance. When i run, the cow & elephant moving to end. I need to stop only some distance. Also is it possibile to movement with legs. Now just obj moving. #pragma strict var pointB : Vector3; function Start () { var pointA = transform.position; while (true) { yield MoveObject(transform, pointA, pointB, 5.0); yield MoveObject(transform, pointB, pointA, 4.0); } } function MoveObject (thisTransform : Transform, startPos : Vector3, endPos : Vector3, time : float) { var i = 0.0; var rate = 1.0/time; while (i < 1.0) { i += Time.deltaTime * rate; thisTransform.position = Vector3.Lerp(startPos, endPos, i); yield; } } function Update () { }

Viewing all articles
Browse latest Browse all 167

Trending Articles



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