Arrow, Spinning and rotating toward the tip
I'm making an arrow, I'm able to make it spin and rotate, but not at the same time. To rotate it (so that the tip falls down) I've used this code:
transform.LookAt(transform.position + rigidbody.velocity);
And this other one:
transform.forward = Vector3.Slerp(transform.forward, rigidbody.velocity.normalized, 10 * Time.deltaTime);
They both works in rotating the arrow. To spin it I use this code:
transform.Rotate(Vector3.forward, rotatioSpeed * Time.deltaTime);
Unfortunately, if it rotates it doesn't spin, the spin code is placed after the rotation code but the arrow spin only if I comment out the latter.
I'm new to Unity, do you have any idea on how to make it rotate and spin at the same time? I'm wondering if it would be possible doing some vector operation (a sum may be the solution), but I'm overwhelmed by the API methods.
Thanks in advance, first question in this site.
Your answer
Follow this Question
Related Questions
How to translate an object in an unknown angle ? 1 Answer
How to make a 2D object tilt smoothly based on mouse movement? 1 Answer
LookAt() and Rotate() - how to use them at the same time? 0 Answers
Rotate arrow without unity physics engine. 0 Answers
transform.rotation interferes with transform.Rotate 1 Answer