Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Join Date
    Sep 2008
    Location
    Salisbury, UK
    Posts
    2,812
    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...

    I found
    my current avatar on google, so props to THIS GUY who created the original...

  2. #12
    Join Date
    Dec 2002
    Location
    Virginia Beach, VA
    Posts
    861
    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.

  3. #13
    Join Date
    Dec 2004
    Posts
    25
    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;

  4. #14
    Join Date
    Sep 2008
    Location
    Salisbury, UK
    Posts
    2,812
    your startDistance = DistanceMax... try setting DistanceMax to 11f

    I found
    my current avatar on google, so props to THIS GUY who created the original...

  5. #15
    Join Date
    Dec 2004
    Posts
    25
    Changed DistanceMax to 11f. No change

  6. #16
    Join Date
    Dec 2002
    Location
    Virginia Beach, VA
    Posts
    861
    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 05:35 PM.

  7. #17
    Join Date
    Dec 2004
    Posts
    25
    Quote Originally Posted by chronos78 View Post
    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.
    Nope, isnt been set back to 0 there

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •