How do I get transform.rotation = Quaternion.identity; run slowly or smooth?
I try add time.DeltaTime but i get errors!?
My goal is when my object collides resumes his position in a smooth manner?
Any adea?
How do I get transform.rotation = Quaternion.identity; run slowly or smooth?
I try add time.DeltaTime but i get errors!?
My goal is when my object collides resumes his position in a smooth manner?
Any adea?
Regarding the general problem of rotating smoothly from one orientation to another, you can use Quaternion.Slerp() for this (see the docs for details).
It is possible create an police lights?
How to Simulate police lights for my policeCar?
Any adea how to?
set a variable outside the function:
private var rotation_speed = Quaternion.Euler(0, XX, 0); xx = how fast you want it to turn
and than in a fixedupdate function:
transform.rotation = transform.rotation*rotation_speed;
if you want to rotate your police lights, but perhaps i missunderstood your question.
It might be easier just to use Transform.Rotate(). For one thing, you could then easily perform the update in Update() and make the speed of rotation framerate-independent using Time.deltaTime.
Tks for the help:)