Hi, I need an object to jump twice in a row: the first jump should end at "position1", and from there, the object should jump to "position2"
Here's my code:
void Start() {
transform.position = Vector3.zero;
// transform.position = Vector3.up; - doesn't work
var position1 = new Vector3 (5, 0, 0);
var position2 = new Vector3 (10, 0, 0);
transform.DOJump (position1, jumpPower: 5f, numJumps: 1, duration: 1f)
.Append (transform.DOJump (position2, jumpPower: 5f, numJumps: 1, duration: 1f));
}
This only works fine when the starting point is at the same height as the target - but if the object starts at (0,1,0), it ends up at (10,-1,0) instead of (10,0,0).
Am I doing something wrong? How do I go about chaining jumps properly?