Don't know, then...
Watch the coding ones again, with your code up, and play spot the difference... I had to do that with one of the other series to find a missing method call...
Don't know, then...
Watch the coding ones again, with your code up, and play spot the difference... I had to do that with one of the other series to find a missing method call...
If your camera is starting inside the capsule then you aren't setting a starting distance and the camera is constantly trying to clear itself or you haven't told your character geometry to be part of the ignore raycast layer. Since it is so close to the lookAtTarget that would account for the flickering and twitchiness you are describing.
So how do i set a starting distance? I believe I already have...
Code:public static TP_Camera Instance; public Transform TargetLookAt; public float Distance = 7f; public float DistanceMin = 3f; public float DistanceMax = 10f; public float DistanceSmooth = 0.05f; public float X_MouseSensitivity = 5f; public float Y_MouseSensitivity = 5f; public float MouseWheelSensitivity = 5f; public float X_Smooth = 0.05f; public float Y_Smooth = 0.01f; public float Y_MaxLimit = -40f; public float Y_MinLimit = 80f; private float mouseX = 0f; private float mouseY = 0f; private float velX = 0f; private float velY = 0f; private float velZ = 0f; private float velDistance = 0f; private float startDistance = 10f; private Vector3 position = Vector3.zero; private Vector3 desiredPosition = Vector3.zero; private float desiredDistance = 0f;
your startDistance = DistanceMax... try setting DistanceMax to 11f
Changed DistanceMax to 11f. No change
Starting distance should also be set in the camera's Reset() method. So make sure it isn't being set back to 0 there. To be safe set startDistance, Distance, and desiredDistance all to something like 5 in the Reset() method and see if that makes a difference. Also make sure that Reset() is being called in the awake or start method don't remember off the top of my head which it was.
Last edited by chronos78; 02-09-2011 at 06:35 PM.