Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Radis

Pages: [1]
1
DOTween & DOTween Pro / Re: Two DOJumps in a sequence
« on: August 13, 2015, 02:19:47 PM »
Ok, nevermind, I ended up writing my own tween instead of using DOJump.

Anyway, I had a look at the source code and I think there are several issues with the DOJump method:

First of all, you should be setting offsetYSet to true in OnUpdate(). And you should probably move " float startPosY = target.position.y;" into OnUpdate(), so that the offset gets computed from the current position of the object instead of the object's position at the time of the DOJump() call - maybe that would solve the issue with chaining jumps with different endValue.y's?

2
DOTween & DOTween Pro / Two DOJumps in a sequence
« on: August 13, 2015, 11:48:20 AM »
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:

Code: [Select]
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?

Pages: [1]