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 - juaxix

Pages: [1]
1
DOTween & DOTween Pro / Re: Position flickering
« on: March 29, 2016, 12:26:17 PM »
Hey Daniele, thanks for the tip!
Yes ,I know it's the same var, my error was supposing that if I change the globalPosition with the startPoint.y == endPoint.y == 0 it would not change in the interpolation, but Y is part of the animation computation as a field of position, so of course it's changing over time together with the localPosition tween XD
I feel dumb lol
Well, now i know what i can i do, separate in 2 tweens, for global x and,z positions with DoMoveX, DoMoveZ and do in the update of one of them the localPosition.Y changes :)
Thanks!

2
DOTween & DOTween Pro / Position flickering
« on: March 22, 2016, 01:27:26 AM »
Hi, I have a three part animation, in the first one the code creates a coin and then moves it from a position to another in global coordinates:
Code: [Select]
           GameObject gCoin = GameObject.Instantiate(
                prefabCoinGO, starts[j].position + Vector3.up*2.5f, starts[j].rotation
            ) as GameObject;
            Transform tCoin = gCoin.GetComponent<Transform>();
            Tween twCoin    = tCoin.DOMove(ends[j].position + Vector3.up*2.5f, timeToTravelCoin)
                .OnComplete(() =>
                {
                    RemoveCoin(gCoin);
                })
            ;

the second and third part, are two more animations but in local space, if i do those with this approach:
Code: [Select]
            float t = Time.time;
            twCoin.OnUpdate(() =>
                {
//I tried with a tCoin.Translate(...,Space.Self) too ,same result
                    Vector3 lPos = tCoin.localPosition;
                    tCoin.localPosition = Vector3.Lerp(
                        lPos,
                        lPos + Vector3.up * Mathf.Sin(
                          Mathf.PI * 100 * Time.deltaTime * (Time.time - t)
                        )*4
                    , Time.deltaTime*10);
                    tCoin.Rotate(Vector3.up * Time.deltaTime * Mathf.PI * 60);
                })
            ;

there are some of the coins that flickers in position, jumping with bad Y coordinates, maybe because it crosses the 0,0,0 point to another axis.

But, if i do this:
Code: [Select]
            tCoin.DOLocalMoveY(-0.23f, 0.6f).SetLoops(-1, LoopType.Yoyo)
                .SetEase(Ease.InOutSine);
            tCoin.DORotate(Vector3.up * 360f, 3f, RotateMode.FastBeyond360)
                .SetLoops(-1, LoopType.Restart).SetEase(Ease.OutSine);
it works perfectly, what if i want to use OnUpdate(), does it keep a good track of the localposition or should i change dotween update for fixedupdate?

3
UPDATE:
I fixed it! it was the wps var, thanks  8)
Hey , testing this code on android

Code: [Select]
            Vector3[] pathPoints = dopathComponent.GetDrawPoints();
            twBallMove = theBall.DOPath(pathPoints, dopathComponent.duration, dopathComponent.pathType, dopathComponent.pathMode, dopathComponent.pathResolution).SetAutoKill(true);

I had this error
Code: [Select]
W/Unity   (22635): DOTWEEN :: Draw points not ready yet. Returning NULL
W/Unity   (22635): 
W/Unity   (22635): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
W/Unity   (22635):
I/Unity   (22635): NullReferenceException: Object reference not set to an instance of an object
I/Unity   (22635):   at GameController.getPerfectShotRepresentation (DG.Tweening.Sequence& seq, Boolean usePlayerMovement) [0x00000] in <filename unknown>:0
I/Unity   (22635):   at GameController.onPlayerKickBall () [0x00000] in <filename unknown>:0
I/Unity   (22635):   at Player.Update () [0x00000] in <filename unknown>:0
I/Unity   (22635): 
I/Unity   (22635): (Filename:  Line: -1)
I/Unity   (22635):

should i have to wait before points to be generated? :|

I understand you can't use the drawPoints in production, i was confused because i think this function will work out of the editor, but it clearly says that it's for unity editor, so, how can i get the waypoints?, i think it's the wps  variable.

4
Installed latest version of the vst and everything back to normal :)

5
Hello my friend, I'm trying to understand what it's new in Unity 5.3.1 because now I can't compile the project in Visual Studio.This is the error:
Code: [Select]
DOTweenAnimation.cs(9,19,9,21): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)

do you know how to fix this error?

6
Yeah, SMART. Daniele, problem solved  ;D i just do this: ballTransform.DOPath(..) ,where the "..." are the DOTweenPath component (configured in the scene) params , saving the points in an Vector3[] aux and modified the latest point, super fast ;)
Thanks
Hi!


Cheers!

7
Hi, I've some DOTweenPath components in gameobjects and I would like to play them in a sequence, can i use this?

Code: [Select]
sequence.Append(path.tween);

path is my DOTweenPath component reference.
Do I need to do this before use it? (i'm going to reuse it so i switch off the autokill and autoplay buttons in editor).
Code: [Select]
path.DOPause();
path.DORestart();

because i have this error if i try to do that:
Code: [Select]

Unhandled Exception: System.ArgumentException: Key duplication when adding: Void DORestart(Boolean)

  at System.Collections.Hashtable.PutImpl (System.Object key, System.Object value, Boolean overwrite) [0x00000] in <filename unknown>:0

  at System.Collections.Hashtable.Add (System.Object key, System.Object value) [0x00000] in <filename unknown>:0

  at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0

  at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0

  at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0

  at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0

  at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0

  at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

  at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

  at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

  at Mono.CSharp.If.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

  at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

  at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

  at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0

Internal compiler error at Assets/Scripts/GameController.cs(594,10):: exception caught while emitting MethodBuilder [GameController::getPerfectShotRepresentation]


Can I modify the latest point of the path and re-evaluate it before play?
something like...
Code: [Select]
path.GetDrawPoints()[path.GetDrawPoints().Length - 1].Set(ballDestiny.x, ballDestiny.y, ballDestiny.z);

8
DOTween & DOTween Pro / Re: Create a paused sequence
« on: January 05, 2016, 09:15:43 PM »
Ok, that's the smartest thing to do ,thanks!

9
DOTween & DOTween Pro / Re: Create a paused sequence
« on: January 05, 2016, 08:13:47 PM »
Do created, stored in vars Tweens and then appended to a Sequence started when the var is created or in the order of the sequence?, example
Code: [Select]
//move player from position to the ball
            Tween twPlayerMove = player.transform.DOMove(
                tBall.position + Vector3.up * 0.7f - Vector3.forward,
                 distance * deltaTime
            ).SetEase(Ease.Linear);
            //change player animation speed with movement acceleration (simulation)
            twPlayerMove.OnUpdate(() =>
            {
                player.animation.clip.frameRate = twPlayerMove.ElapsedPercentage() * 60f;
            });
            seq.Append(twPlayerMove);

is this Tween already started before appended or does it start inside the sequence?

10
DOTween & DOTween Pro / Re: How to smoothly kill an infinite loop sequence
« on: November 23, 2015, 01:18:16 PM »
Oh, ok, thanks for this

11
DOTween & DOTween Pro / Re: How to smoothly kill an infinite loop sequence
« on: November 23, 2015, 12:20:21 PM »
I see, how about just setting the loops to 0?

12
DOTween & DOTween Pro / Re: How to smoothly kill an infinite loop sequence
« on: November 23, 2015, 11:04:54 AM »
I like this

Code: [Select]
Tween myTween;

void CreateTween()
{
   myTween = image.DOColor(myColor, 1).SetAutoKill(false);
   myTween.OnComplete(myTween.Restart);
}

void SmoothKillTween()
{
   myTween.OnComplete(null);
   myTween.SetAutoKill(true);
}
But it returns an error: cannot convert from method group to TweenCallback, i think you should use something like
Code: [Select]
   myTween.OnComplete(()=>myTween.Restart());

And...still ,why not something like this?:
Code: [Select]
Tween myTween;

void CreateTween()
{
  myTween = image.DOColor(myColor, 1).SetLoops(-1,LoopType.Restart);
}

void SmoothKillTween()
{
   myTween.SetLoops(0);
   myTween.Complete();
   myTween.Kill(); //?
}

13
DOTween & DOTween Pro / Problem with multiple OnComplete functions
« on: November 23, 2015, 10:57:03 AM »
I'm having an issue with OnComplete in Tweens (not sequences).
When I use .OnComplete function and a DoVirtual.DelayedCall inside the function, this is delayedcall never happen.
I think it must be something related to a number of limits in calls ,like a stack limit.
Can you confirm this please?

example:
transform.DOMoveX(2f, 1f).OnComplete(() => { DOVirtual.DelayedCall(1f, () => { transform.DOMoveX(0f, 1f).OnComplete(() => { Debug.Log("Position 0"); }); });  });

that works perfectly but there is some cases ,more complicated , when the delayedcall is not working, when the amount of subsequent calls increases.

Pages: [1]