New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lockRotation has no effect with DOPath & SetLookAt #167
Comments
Hi, I made some tests but everything seems ok here. Are you sure the transform is rotating around the Z axis? The fact that the euler Vector3 Z value changes, doesn't mean it's truly rotating around Z, since that is just a conversion from Quaternion, and the resulting euler isn't indicative. Cheers, |
Thanks, the issue was that I assumed that it was rotating around the euler axis, not a quaternion axis. For anyone reading this in the future who is curious, I ended up achieving the effect I wanted by just doing DOPath simultaneously with DORotate in a sequence:
|
Hey, I'd like to revive this thread, as my workaround in my previous comment of just using a simultaneous I am trying to use Is there any possible way to use |
Uhm that is weird. Can you send me a screenshot of your path so I can check it out? |
P.S. Also, can you show me your DOPath code? |
Thanks for the quick reply. I went ahead and created an example standalone Unity project that showcases the behavior I'm talking about. (Import the asset package in the above zip into a brand new Unity project, then play the included scene and press the space bar to start the path. Created/tested with Unity 2017.1.0f3 and it includes DOTween v.1.1.695) Here's what it looks like in action: As you can see in the Game view and the Inspector, DOTween is rotating the Camera's transform on the Euler Z axis, resulting in a tilted view of the world (easily seen by the fact that the skybox's horizon is tilted). Thanks again, and let me know if I can provide any more information. |
Hi, I'm having the same trouble I have this code Vector3[] waypoints = new[] { new Vector3(33f, 40f, 0f), new Vector3(32.8f, 40.7f, 0f), new Vector3(32f, 41f, 0f), new Vector3(31f, 41f, 0f) };
On a 2D game, and my game object rotates the X and Y axis, so the sprite dissapears, this happens even if I place the lockRotation X and Y axis, so it's not rotating around the Z axis, tried with code and with the visual path editor, same results, is this a bug? Thanks Soki |
I just noticed, it seems to be swapping the axis So instead of rotating around Z, it rotates around X, Z and Y get swapped between them Thanks Soki |
So I was able to get it to work by specifying the forwardDirection as Vector3.right (?!) and up vector as Vector3.Forward, this is really confusing, only thing is when the path is done, it still changes the rotX and rotY, it kind of works, but sometimes I end up with weird XYZ values... |
Heyhey, @Demigiant @mrtenda @sokigakiya I had the same problem as you guys so I decided to look at the source code :) In Pathplugin.cs, SetOrientation the rotation is set for the animating object.
For the up-vector in the Quaternion.LookRotation you're using the up of the object you're animating, while to achieve the effect we want you should use the up of the world (Vector3.up) You can download the source-code, change it yourself and rebuild the dll or try my build version from the link :) (I didn't manage to recreate the mdb file so unity will give an error about a non-matching symbol file but you can just ignore that) Cheers! |
Ahoy! |
I'm having the same trouble too! |
I am also having this issue. Is there a way to add features to DOTween, like a LookAt extension that resolves this issue? I'd really love to be able to go in and just correct the issue myself. |
Also having this issue, var s = DOTween.Sequence(); by the end of DoPath, |
Any official Fix? |
It seems like a lot of people have been struggling with this since I first opened this issue. I have no idea if an official fix will happen (or has already happened?), but I managed to work around this problem a while ago by using DOPath and then independently also updating the Transform's rotation on every Update to rotate towards the target. However, if you're dealing with this problem because you're using DOTween on a camera (like I was), I highly suggest not using DOTween at all for camera movement and instead using Cinemachine (which is free and included with Unity). DOTween is a great tool but Cinemachine is built especially for cameras, so it's perfectly suited for this kind of thing (and has many other camera-specific capabilties too). |
@Demigiant hehe I commented on this more than 2 years ago, didn't use DOTween anymore until now, downloaded it again because I do think its great, found out issue is still there... |
I am so ashamed. I did so many other things in order to avoid this, because I couldn't find a nice way to implement it and it's my personal hell. But now I did it. I'm not superhappy but I simply added an overload to SetLookAt where you can set a "stableZRotation" parameter to TRUE and it will use your fix :B Get it here :P |
stableZRotation fixed it for me. Thank you! |
@Demigiant have you released an official fix? If not can you make the above zip available again? The link has expired. |
Ahoy! This had been released already, but you can get the latest version here which I just uploaded (coming in a few days to the Asset Store too) |
Much appreciated. 👍 |
@Demigiant I'm guessing your fix was only for the overload? Because I can't see anything changed in the DoTweenPath component |
Hello, I am trying to use DOPath and SetLookAt to traverse the camera along a path while keeping the camera looking at the hero. Here's the code I am running:
However, despite specifying a locked rotation axis constraint of Z, the transform still rotates on the Z axis during the tween. The starting rotation for the transform is shown as
(20, 0, 0)
in the Unity inspector, and the final rotation for the transform at the completion of the tween is shown as(139.238, -1.85199, 104.181)
.Is this the expected behavior? If so, what would the correct way to do this be? Thanks.
(I am using DOTween Pro if that's relevant)
The text was updated successfully, but these errors were encountered: