- Home /
Problem is not reproducible or outdated
Choppy movement of moving quad with rotating camera
Hi everyone! I'm making a similar Mario Kart game. I'm using Quads, one for the ground, and one for each racer. The quads use billboarding to always face the camera (May I clarify that the ground stays put, only the racers use billboarding).
In the main menu I set the camera to rotate along the center of the track while the AI racers run in the track.
My problem is that the racer's Quads move a bit "jerky/stuttery/flickery/choppy" (I googled a lot and found a question using those terms, as non native English speaker, I THINK those describe my problem pretty good)
To move the camera I use:
transform.LookAt(Vector3.zero); // To always face the center of the track
transform.Translate(Vector3.right *10* Time.deltaTime); // To move in circle along the center of the track
For the billboarding in the racer's quad's, I use either this:
//transform.rotation = Camera.main.transform.rotation;
Or (currently) this:
var fwd = Camera.main.transform.forward;
fwd.y = 0.0f;
transform.rotation = Quaternion.LookRotation(fwd);
To move the racer's quad's I use:
transform.Translate(Vector3.forward * Time.deltaTime * CurrentSpeed);
Thanks in advance!
EDIT: Not sure if it helps, the racer's quad have a RigidBody attached to them and a Mesh Collider as Trigger. The rigid body has "use gravity" unchecked and is only used alongside with the mesh collider to detect trigger events
Answer by etaxi341 · Nov 24, 2014 at 07:54 PM
This could Fix your bug (Not sure but it could work) You should use Camera Movement always in LateUpdate Methods. Try it out :)
I hope it helps.
Thanks! At least it's something! I'll try it out right away
While trying to recreate the problem at home, I found that the choppiness could be related to the sprite assignment as I believe, in the project at work, I assign the racer's sprite all the time in the Update() billboard script. $$anonymous$$orrow I'll check this out at work plus your suggestion :)