How to apply rotation with given axis
Hi, im working with a gps system, and i need to translate a transform to certain direction and rotate it with a given axis.
To test, i used inputs and transform.RotateAround and it works perfectly how i wanted, but the problem is that i dont have inputs with the GPS, i just have the target position and i cant rotate instantly with transform.RotateAround.
This is what i use with inputs:
tractor.RotateAround(axis.position, tractor.position, Input.GetAxis("Vertical") * Time.deltaTime * velocity);
Is there any way to rotate instantly a transform with a given axis? Instead of rotating over time?
Something like this:
tractor.rotation = tractor.RotateAround(axis.position, tractor.position, newAngle);
Thanks in advance
Your answer
Follow this Question
Related Questions
Rotate an Object while moving forward using empty gameObject 0 Answers
Make GameObject rotate around another around random axis but with fixed distance 0 Answers
Why my RotateAround() function doesn't work? 0 Answers
Rotating Camera around Player's X-axis while rotating Player around its Y-axis (using mouse input) 0 Answers
Camera self rotation script problem 1 Answer