moving object

:smile: Hi i am new in this forum…
i create this code for moving object,is work correctly, but i want moving object to min position to max position with slow speed sequense (example elevator with start slow,fast,slow,stop in up and same in down)but i have some trouble for insert a time sequense animation or other in this code…sorry for my bad english

the code

var object : Transform;
var min : float = 0.05;
var max : float = 10.35;

function Update () {
if (Input.GetKeyDown(KeyCode.U)) {
object.position.y = max;
}

if (Input.GetKeyDown(KeyCode.J)) {
object.position.y = min;
}
print(object.position.y);
}

thank you every people in this forum for your help :slight_smile:

I found solution with Ani.mate.To

the code

var object : Transform;
var min : float = 0.05;
var max : float = 10.35;
var speed : float = 10;
function Update () {
if (Input.GetKeyDown(KeyCode.U)) {
// object.position.y = max;
options = {“easing”: CubicEasing, “direction”: EasingType.InOut};
Ani.Mate.To(object, speed, {“position”: Vector3(84.63313,max,71.43969)},options);
}

if (Input.GetKeyDown(KeyCode.J)) {
// object.position.y = min;
options = {“easing”: CubicEasing, “direction”: EasingType.InOut};
Ani.Mate.To(object, speed, {“position”: Vector3(84.63313,min,71.43969)},options);
}
print(object.position.y);
}
:smile: :smile: