- Home /
Rotation using exponential functions
I am trying to make rotation using exponential functions, but an error comes up telling me "cannot convert 'double' to 'float' "
My code:
transform.Rotate (0, 0, Math.Exp( - touch0.position.x - rotationRate));
where touch0.position.x is the horizontal position of where the touch is, and rotationRate is the rotation speed.
Answer by Captain_Pineapple · Jun 24, 2018 at 07:50 AM
Hey there,
what you are missing are a few f
behind numbers to specify that you are handling floats here:
transform.Rotate (0f, 0f, Math.Exp( - touch0.position.x - rotationRate));
That should work.
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Rotating Joystick on Touch 0 Answers
How to rotate about 360 on a coroutine 3 Answers
How to always rotate clockwise 1 Answer
Making a rotating object rotate with a parent object 1 Answer