Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Dec 2002
    Location
    Virginia Beach, VA
    Posts
    861

    Correction to 3rd Person Character System Jumping Method in TP_Animator Class

    I have to thank clintman for pointing out an error in my logic concerning when to initiate the landing animation for the Jumping method of the TP_Animator class. What can I say it was a late night of recording. So here is a corrected version without the redundant logic and should make the jumping animation sequence look better.

    Code:
        void Jumping()
        {
            if (TP_Controller.CharacterController.isGrounded)
            {
                if (lastState == CharacterState.Running)
                    animation.CrossFade("RunLand");
                else
                    animation.CrossFade("JumpLand");
                State = CharacterState.Landing;
            }
            else if (!animation.IsPlaying("Jump"))
            {
                State = CharacterState.Falling;
                animation.CrossFade("Falling");
            }
            else
            {
                State = CharacterState.Jumping;
                if (transform.position.y > TP_Motor.Instance.StartFallHeight)
                    TP_Motor.Instance.StartFallHeight = transform.position.y;
            }
        }

  2. #2
    Join Date
    Dec 2010
    Posts
    91
    Thanks for posting this, I thought the initial if statement was weird, but....

    Quote Originally Posted by chronos78 View Post
    Code:
                if (transform.position.y > TP_Motor.Instance.StartFallHeight)
                    TP_Motor.Instance.StartFallHeight = transform.position.y;
    I don't remember this StartFallHeight being a part of the VTMs at all? I am guessing that is code we'll see in a future VTM? (That you are totally posting this weekend)

  3. #3
    Join Date
    Jan 2011
    Posts
    102
    This weekend sounds great! haha
    You're correct, that if statement was not presented in the current videos.

  4. #4
    Join Date
    Dec 2002
    Location
    Virginia Beach, VA
    Posts
    861
    The start falling height comes later in the videos. Disregard that part of the method till you get the next drop of videos.

  5. #5
    Join Date
    Mar 2002
    Location
    Long Island
    Posts
    1,673
    Thanks Chronos!
    Please let me know when we are going to have some fun so I can pay attention.


  6. #6
    Join Date
    Jul 2006
    Location
    San Diego, CA, USA
    Posts
    897
    Thanks Lee and clintman.

  7. #7
    Join Date
    Mar 2011
    Posts
    2
    Thank you

  8. #8
    Join Date
    Jun 2008
    Location
    Iran / Tehran
    Posts
    285

    More changes can be added for fatal height now :

    Hi
    after changing the code as you mentioned above, now we can change more codes :
    if you pay attention to the videos, when lee is testing the fatal height and changes it to .1 and jumps nothing happens, well it shouldn't be like that, I mean when you are jumping you are higher than .1 and you are in fatal fall position, now if you change the jumping code as mentioned above, you can delete all the IsFalling code in TP_Motor and can delete isFalling there too, just add this code in tp_Controller's update at the bottom, right after update motor call :
    Code:
    if (TP_Motor.Instance.StartFallHeight - transform.position.y > TP_Motor.Instance.FatalFallHeight && CharacterController .isGrounded )
                Die();
    now test the game, change the fatal height to .1 and do a simple jump and.... u'll die !
    Last edited by css_maya; 05-14-2011 at 03:09 PM.
    If you want to learn something, start teaching about it to others, nothing will help you more than that !

  9. #9
    Join Date
    Dec 2011
    Posts
    2

    Helpme

    Hi I have the script of TP and would like to make my character has rotation on the drive. What should I do?

  10. #10
    Join Date
    Oct 2011
    Posts
    8
    Begging your pardon, but I can't seem to find the video where StartFallHeight is introduced. However, in Video "33 - Fatal Falling" a
    startFallHeight (lower case) is declared in TP_Motor as: " private float startFallHeight; "

    Is this detailed in different video perhaps? If so, could someone please list the title of the video?

    Thank you!

Page 1 of 2 12 LastLast

Posting Permissions

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