- Home /
Question by
Lumpy Relish · Apr 08, 2013 at 05:42 PM ·
beginnercharacter movement
How do I make an imported asset into a character which can only move along one axis?
I have imported a model from 3ds which is a robotic arm on a linear rail. I am new to unity and javascript and I need to make the arm move along the rail in fixed increments of a specified distance whilst having a smoothly animated movement between the points.
Can anyone help?
Thanks
Comment
Answer by LyanApps · Apr 09, 2013 at 07:13 PM
http://docs.unity3d.com/Documentation/ScriptReference/Transform.Translate.html
function Update() {
if(Input.GetButton("UP")){
// Move the object forward along its z axis 1 unit/second.
transform.Translate(Vector3.forward * Time.deltaTime);
}
}