![]() Just see them as magic black boxes which encode a rotation around an arbitrary axis in 3d space by a certain angle and move on with your life. You can be a perfectly competent Unity developer when you just accept that the inner workings of quaternions are black magic. But that's no problem when using Unity, because it provides so many useful convenience methods for working with quaternions that you will never encounter a situation where you really need to. I don't fully understand the math behind quaternions either. There is a warning in the Unity documentation about Quaternion class:ĭon't modify this directly unless you know quaternions inside out. Let me know if you need more info, thanks! And yes, interpolation is on in the rigidbody component. How do I prevent this error from happening, and how do I slow down the rotation?(changing the values doesn't seem to help). However, when I did this, the throwing arm rotated 180° almost instantly, and then the same error got thrown a bunch of times. I can't find a reference to that in the unity API, and the one solution I found online was to use the Quaternion's normalize attribute. This has been giving me the error Rotation quaternions must be unit length. TargetRotation=rigidbody.rotation //rigidbody is a Rigidbody object ![]() Quaternion targetRotation= new Quaternion(0f,0f,(float)(-5*ltaTime),0f) I use the following code for my update function(just as a test): void Update() The cup of a catapult needs to use Rigidbody.MoveRotation to let a ball respond to being thrown in the physics engine. I'm making a game that involves throwing things with catapults.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |