We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
LookTargetControl で向きを変えたい場合、 Target と自身の y 座標に乖離があればあるほど、うまく角度が変わりません。 これは、 Vector3.SignedAngle() でヨーを計算する際に回転軸が傾いてしまうためです。
Vector3.SignedAngle()
以下のパッチで修正することが可能です:
diff --git a/Packages/com.utj.charactercontroller/Runtime/Components/Control/LookTargetControl.cs b/Packages/com.utj.charactercontroller/Runtime/Components/Control/LookTargetControl.cs index f81fd3f..36d456e 100644 --- a/Packages/com.utj.charactercontroller/Runtime/Components/Control/LookTargetControl.cs +++ b/Packages/com.utj.charactercontroller/Runtime/Components/Control/LookTargetControl.cs @@ -52,6 +52,7 @@ namespace Unity.TinyCharacterController.Control return 0; var delta = Target.position - transform.position; + delta.y = 0; return (delta.sqrMagnitude > 0) ? Vector3.SignedAngle(Vector3.forward, delta, Vector3.up) :
The text was updated successfully, but these errors were encountered:
No branches or pull requests
LookTargetControl で向きを変えたい場合、 Target と自身の y 座標に乖離があればあるほど、うまく角度が変わりません。
これは、
Vector3.SignedAngle()
でヨーを計算する際に回転軸が傾いてしまうためです。以下のパッチで修正することが可能です:
The text was updated successfully, but these errors were encountered: