Search Unity

How do I get a working ladder in my 2D Sidescroller?

Discussion in 'Scripting' started by KiritoKazuto99, Jul 25, 2014.

  1. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    If anyone can tell me how to get a working ladder in my 2d side scroller that would be great. I have no idea where to start since this is my first time making a game, and, I just started making it 4 days ago.
    The game looks 2d except for the character, but everything is made out of simple cubes.

    Here is a video of how it looks:


    I am testing the player controls with the Player Controller script in this video:

    It doesn't use gravity, it's kinematic
     
    Last edited: Jul 25, 2014
  2. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Hmm...Interesting. Well off the top of my head I would suggest you have box collider on the ladder IF possible and have a trigger happen on the player script / input manager when it comes near it. This way you can then trigger the up arrow to then allow the player to animate and move its position upwards so long as it is near the ladder. Also, what would be nice if the ladder itself would relay back to you the height of it, this way you can check if you are almost to the top and have the player animate to turn left or right. This way the player can actually get on solid ground rather then go up to the top, then fall again. Make sense?
     
  3. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    It makes sense, but I just don't know how to do the scripting myself just yet. I am currently learning how to do all of this coding stuff, but it's only been 4 days...
     
  4. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Ah no worries dude, I got your back. First off, this script he has is great BUT its how would you say...not fully complete? Essentially it is not ideal to "hardcode" anything. You want to create a robust system where you can employment X amount of controls and feel confident you can port this on any system and feel like a champ. What I do is use a Singleton Paradigm in C# that I call InputManager that allows me to relay info to InputManager with delegates and events to trigger things. My Player script varies. For this situation you seem to have a basic JUMP, LEFT, RIGHT motion here am I right?
     
    Last edited: Jul 25, 2014
  5. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    Yes
     
  6. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    I used to be a tutor for Computer Science so I like to help people and you seem interested in programming so I am here to help. What I recommend is to create a structure for your inputs. The InputManager I was talking about can help you have a means of connecting your player to actions. By this I mean on your keyboard when you say hit LEFT the player should move to the left. When you hit a SPACE you expect it to lets say jump. For this, in no way shape or form should the player ever even check if anything has happen, so there should be NO update method for player for controllers EVER.

    Like I said before it is ideal to use Object-Oriented Design patterns to help you in situations like these. So for this character there will be some things we have to take into consideration such as environments and so forth. Here is the singleton design pattern I was talking about that I can take you through (http://msdn.microsoft.com/en-us/library/ff650316.aspx)

    What I feel, and this is my opinion, is to have have a script for your individual controllers that then trigger an event that will then fire the player to move.

    So for now, lets look at implementing our InputManager.cs

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public sealed class InputManager : MonoBehaviour {
    5.     private static readonly string _tag = "InputManager"; // This will be used to find the prefab in the game with a specific tag.
    6.     private static InputManager _instance; // This holds the reference to InputManager.
    7.  
    8.     // This is a static property that returns the refernce to InputManager.
    9.     public static InputManager Instance {
    10.         // The 'get' keyword is an accesor
    11.         get {
    12.             // This 'if' statements check if the InputManager reference is null meaning if it exits or not.
    13.             if(InputManager._instance == null) {
    14.                 // If the refernce, _instance, is null lets try to find it in the scene.
    15.                 // This finds the game object we will create as a prefab that holds this script.
    16.                 GameObject inputManager = GameObject.FindGameObjectWithTag(InputManager._tag);
    17.  
    18.                 // Now we check the game object if it is null or not if not, lets get the component of InputManager
    19.                 if(inputManager != null) {
    20.                     // This returns a reference to the compenent of InputManager and assigns it to _instance.
    21.                     InputManager._instance = inputManager.GetComponent<InputManager>();
    22.                 }
    23.  
    24.                 // Here we check if the _instance is still null, meaning have we still not found InputManager?
    25.                 if(InputManager._instance == null) {
    26.                     // If we have not, then we have to create and log an error letting the progammer know that InputManager is NOT in the scene and to fix it.
    27.                     Debug.LogError(typeof(InputManager).ToString() + ": Could not find Game Object with Tag: " + InputManager._tag);
    28.                 }
    29.             }
    30.  
    31.             // FINALLY we return the reference.
    32.             return InputManager._instance;
    33.         }
    34.     }
    35. }
    So here I implemented the singleton design. This allows me to have a ways to connect to the InputManager that will then trigger events later, I will show you, that will have your player move and climb your ladder.
     
    Last edited: Jul 25, 2014
  7. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    Hmm, I am a bit confused on what this is and how it works. Do you want me to make a script with that though?
     
  8. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public sealed class InputManager : MonoBehaviour {
    5.     private static readonly string _tag = "InputManager"; // This will be used to find the prefab in the game with a specific tag.
    6.     private static InputManager _instance; // This holds the reference to InputManager.
    7.  
    8.     // This is a static property that returns the refernce to InputManager.
    9.     public static InputManager Instance {
    10.         // The 'get' keyword is an accesor
    11.         get {
    12.             // This 'if' statements check if the InputManager reference is null meaning if it exits or not.
    13.             if(InputManager._instance == null) {
    14.                 // If the refernce, _instance, is null lets try to find it in the scene.
    15.                 // This finds the game object we will create as a prefab that holds this script.
    16.                 GameObject inputManager = GameObject.FindGameObjectWithTag(InputManager._tag);
    17.  
    18.                 // Now we check the game object if it is null or not if not, lets get the component of InputManager
    19.                 if(inputManager != null) {
    20.                     // This returns a reference to the compenent of InputManager and assigns it to _instance.
    21.                     InputManager._instance = inputManager.GetComponent<InputManager>();
    22.                 }
    23.  
    24.                 // Here we check if the _instance is still null, meaning have we still not found InputManager?
    25.                 if(InputManager._instance == null) {
    26.                     // If we have not, then we have to create and log an error letting the progammer know that InputManager is NOT in the scene and to fix it.
    27.                     Debug.LogError(typeof(InputManager).ToString() + ": Could not find Game Object with Tag: " + InputManager._tag);
    28.                 }
    29.             }
    30.  
    31.             // FINALLY we return the reference.
    32.             return InputManager._instance;
    33.         }
    34.     }
    35.     public delegate void Action(MovementType direction, Vector3 movementVector = default(Vector3));
    36. }
    37. /// <summary>
    38. /// Movement type.
    39. /// </summary>
    40. public enum MovementType {
    41.     NONE = 0,
    42.     MoveRight,
    43.     MoveLeft,
    44.     MoveForward
    45. }
    The next thing we want to do is create something that represents parameter list signatures and return types. This is known as a delegate. "A delegate is a type that represents references to methods with a particular parameter list and return type. When you instantiate a delegate, you can associate its instance with any method with a compatible signature and return type. You can invoke (or call) the method through the delegate instance." (http://msdn.microsoft.com/en-us/library/ms173171.aspx). So of course we will add this to our InputManager
     
    Last edited: Jul 25, 2014
  9. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Yes, this way you can make your controllers for your game for the keyboard and later on implement it for touch too. By making it very generic and nothing hardcoded you can allow yourself to create extensive and reusable code for any situation with little changes to no changes.
     
  10. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
  11. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    I added some comments so you can see how this script works.
     
  12. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    Ok, reading over it now.
     
  13. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Now that we have that we can now move on to create our trigger. Now in C# there is a type known as an event, this event is going to allow us to trigger the delegate by which any script can "register" to it. "An event is a message sent by an object to signal the occurrence of an action. The action could be caused by user interaction, such as a button click, or it could be raised by some other program logic, such as changing a property’s value. The object that raises the event is called the event sender." (http://msdn.microsoft.com/en-us/library/edzehd2t(v=vs.110).aspx)For instance, suppose you have a Keyboard.cs script that waits for certain keyboard keys to be hit in order for the Keyboard to do its thing such as LEFT arrow. For this, our Keyboard when it sees the LEFT arrow getting hit it needs to report this to the InputManager and say "Hey trigger movement LEFT", the InputManager does not care if this came from a touch controller or Keyboard it just waits until something happens and it then fires off its events. So we now have to add our event add this
    Code (CSharp):
    1. public event Action move;
    under the delegate. This is now how we can connect our controllers to InputManager so it can react to interactions from the user such Keystrokes, touches or whatever you want even accelerometer for devices that support this. Does this makes sense or am I losing you? I want to make sure you start off with good code designs and good coding styles so you can be a great coder.
     
  14. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    Ok got it, I'm still alive with this :\
     
  15. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Haha okay, ima step out really quick be back in 15 min. Read over the notes and look at the MSDN definitions so you can get a good perspective. Once you see your player moving around you will see how good code design can make things a lot easier for you :)
     
  16. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    Actually, I had an idea of what you were saying, but now I'm confused at what to do. I made the InputManager script but what do I do with it? How do I tell it which key does what, and how do I ge those keys to actually do something?
     
  17. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    I also have another question, why are the textures on the blocks all blurry?
     
  18. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    I'm back. As to your first question, we are going to create our KeyboardController.cs script and from there you will see how EVERYTHING comes together.

    As to your second question it really depends on the original textures. If the original textures are low res and you try to scale them up it can cause a loss in resolution as the pixels become stretched.
     
  19. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    So looking back so we can finish off our InputManager we need to create the method that will be triggered by any of our controllers when an event is raised.

    Add this method to InputManager

    Code (CSharp):
    1.     // Event Invocation
    2.     public void Move(MovementType direction, Vector3 movementVector = default(Vector3)) {
    3.         // Checks if the event trigger has any methods registered to it.
    4.         if(this.move != null) {
    5.             // If it does execute those methods.
    6.             this.move(direction, movementVector);
    7.         }
    8.     }
    Understand this, I named the method "Move" BUT it does not need to be called this. You can call it whatever you want to call it totally up to you. The method signature for the parameter list MUST be the same as the delegate.
     
  20. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Screen Shot.png So now in Unity3D:
    1.) Create an empty Game Object
    2.) Add the InputManager script to it.
    3.) Create a tag "InputManager"
    4.) Assign the tag to the new Game Object
    5.) Rename the Game Object to "InputManager" (Optional, but lets you know what this game object is doing.)
     
  21. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
  22. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Now lets create our KeyboardController.cs script! With this script we will connect our keyboard interactions with InputManager.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. /// <summary>
    5. /// Keyboard controller.
    6. /// This class waits for Keystrokes on the keyboard and informs InputManager there was Input.
    7. /// </summary>
    8. public sealed class KeyboardController : MonoBehaviour {
    9.     public KeyCode leftMovement = KeyCode.None; // Keycode from keyboard assign it via the Unity Editor
    10.     public KeyCode rightMovement = KeyCode.None; // Keycode from keyboard assign it via the Unity Editor
    11.  
    12.     void Update() {
    13.         // Checks if the keycode for 'leftMovement' is being pressed on the keybaord
    14.         if(Input.GetKey(this.leftMovement)) {
    15.             // If it is being pressed, tell InputManager to invoke "Move"
    16.             InputManager.Instance.Move(MovementType.MoveLeft, new Vector3(1,0,0));
    17.         }
    18.  
    19.         // Checks if the keycode for 'rightMovement' is being pressed on the keybaord
    20.         if(Input.GetKey(this.rightMovement)) {
    21.             // If it is being pressed, tell InputManager to invoke "Move"
    22.             InputManager.Instance.Move(MovementType.MoveRight, new Vector3(1,0,0));
    23.         }
    24.     }
    25. }
    Now attach this to a game object and edit the KeyCodes. Notice I made them prefabs so I can insert them into scenes as needed. Screen Shot Keyboard.png
     
  23. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
  24. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Now lets create our Player.cs and connect to the event from InputManager.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. /// <summary>
    5. /// Player.
    6. /// This class defines our player and its properties.
    7. /// </summary>
    8. public class Player : MonoBehaviour {
    9.     public float speed = 10.0f; // Edit this via inspector
    10.  
    11.     void Start() {
    12.         // Make sure to register to our events when this script is starting.
    13.         this.RegisterEvents();
    14.     }
    15.  
    16.     // Method to move the player.
    17.     void MovePlayer(MovementType movementType, Vector3 movementVector = default(Vector3)) {
    18.         // Checks if the movement is to the LEFT
    19.         if(movementType == MovementType.MoveLeft) {
    20.  
    21.             // If the vector passed is not a 0,0,0 vector
    22.             if(movementVector != default(Vector3)) {
    23.                 // If it isn't lets create our new vector to move our player.
    24.  
    25.                 // so here we can move our player left on the X-Axis.
    26.                 Vector3 newPosition = new Vector3(this.speed * movementVector.x * Time.deltaTime, 0.0f, 0.0f);
    27.  
    28.                 // Updates the transform position by subtracting the new vector.
    29.                 this.transform.position -= newPosition;
    30.             }
    31.         } else if(movementType == MovementType.MoveRight) {
    32.             if(movementVector != default(Vector3)) {
    33.                 Vector3 newPosition = new Vector3(this.speed * movementVector.x * Time.deltaTime, 0.0f, 0.0f);
    34.            
    35.                 this.transform.position += newPosition;
    36.             }
    37.         }
    38.     }
    39.  
    40.     // Connect methods from Player to InputManager
    41.     void RegisterEvents() {
    42.         // This registers the MovePlayer method to the 'move' event.
    43.         // Again notice I named the method MovePlayer, they DO NOT need to be named 'Move'
    44.         // as log as you register to the corrent event with the correct paremeter list
    45.         // all is good.
    46.         InputManager.Instance.move += this.MovePlayer;
    47.     }
    48. }
    Now for testing purposes, I created a cube and added the Player.cs script. Here is a link to my screen recording with the cube moving left and right. As you can see it is very responsive I can make quick changes from left and right it responds very fast.

    Screen Shot Player.png
     
  25. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Make sense so far?
     
  26. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
  27. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Where you able to get your cube / player moving?
     
  28. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
  29. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Sweet. On to the ladder.
     
  30. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    One question first, I imported my Minecraft player in to it and put the script on him. but the animation transition isn't working
     
  31. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    It has the animation of him standing still, breathing, but the walking doesnt work
     
    Last edited: Jul 25, 2014
  32. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Ah I see.
     
  33. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    There is two possible resolutions to this. First are you using mecanim or using the animation component to transition between animations?
     
  34. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    I think the animation component
     
  35. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    Im using the animator component
     
  36. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    In the old script there should have been a line of code that called the animation. Can you post me that line of code?
     
  37. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Actually I got you, you are using the mecanin animations that either you created or someone else but edited via the Animator window right?
     
  38. Teremo

    Teremo

    Joined:
    Jul 8, 2014
    Posts:
    82
    For a first timer, I'm impressed. I'm a first timer too and so far I've gotten a ball to bounce. lol.
     
    Polymorphik likes this.
  39. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    Lol
     
  40. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    That sounds correct I think :p
     
  41. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    How are triggering the animations with conditions and if so what are the conditions?
     
  42. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    I think this is it, Im not sure:
    animationSpeed = IncrementTowards(animationSpeed,Mathf.Abs(targetSpeed),acceleration);
    animator.SetFloat("Speed",animationSpeed);

    This is the whole script for the controller:
    [RequireComponent(typeof(PlayerPhysics))]
    public class PlayerController : Entity {

    // Player Handling
    public float gravity = 20;
    public float walkSpeed = 8;
    public float runSpeed = 12;
    public float acceleration = 30;
    public float jumpHeight = 12;
    public float slideDeceleration = 10;

    private float initiateSlideThreshold = 9;

    // System
    private float animationSpeed;
    private float currentSpeed;
    private float targetSpeed;
    private Vector2 amountToMove;
    private float moveDirX;

    // States
    private bool jumping;
    private bool sliding;
    private bool wallHolding;
    private bool stopSliding;


    // Components
    private PlayerPhysics playerPhysics;
    private Animator animator;
    private GameManager manager;


    void Start () {
    playerPhysics = GetComponent<PlayerPhysics>();
    animator = GetComponent<Animator>();
    manager = Camera.main.GetComponent<GameManager>();
    animator.SetLayerWeight(1,1);
    }

    void Update () {
    // Reset acceleration upon collision
    if (playerPhysics.movementStopped) {
    targetSpeed = 0;
    currentSpeed = 0;
    }


    // If player is touching the ground
    if (playerPhysics.grounded) {
    amountToMove.y = 0;

    if (wallHolding) {
    wallHolding = false;
    animator.SetBool("Wall Hold", false);
    }

    // Jump logic
    if (jumping) {
    jumping = false;
    animator.SetBool("Jumping",false);
    }

    // Slide logic
    if (sliding) {
    if (Mathf.Abs(currentSpeed) < .25f || stopSliding) {
    stopSliding = false;
    sliding = false;
    animator.SetBool("Sliding",false);
    playerPhysics.ResetCollider();
    }
    }

    // Slide Input
    if (Input.GetButtonDown("Slide")) {
    if (Mathf.Abs(currentSpeed) > initiateSlideThreshold) {
    sliding = true;
    animator.SetBool("Sliding",true);
    targetSpeed = 0;

    playerPhysics.SetCollider(new Vector3(10.3f,1.5f,3), new Vector3(.35f,.75f,0));
    }
    }
    }
    else {
    if (!wallHolding) {
    if (playerPhysics.canWallHold) {
    wallHolding = true;
    animator.SetBool("Wall Hold", true);
    }
    }
    }

    // Jump Input
    if (Input.GetButtonDown("Jump")) {
    if (sliding) {
    stopSliding = true;
    }
    else if (playerPhysics.grounded || wallHolding) {
    amountToMove.y = jumpHeight;
    jumping = true;
    animator.SetBool("Jumping",true);

    if (wallHolding) {
    wallHolding = false;
    animator.SetBool("Wall Hold", false);
    }
    }
    }


    // Set animator parameters
    animationSpeed = IncrementTowards(animationSpeed,Mathf.Abs(targetSpeed),acceleration);
    animator.SetFloat("Speed",animationSpeed);

    // Input
    moveDirX = Input.GetAxisRaw("Horizontal");
    if (!sliding) {
    float speed = (Input.GetButton("Run"))?runSpeed:walkSpeed;
    targetSpeed = moveDirX * speed;
    currentSpeed = IncrementTowards(currentSpeed, targetSpeed,acceleration);

    // Face Direction
    if (moveDirX !=0 && !wallHolding) {
    transform.eulerAngles = (moveDirX>0)?Vector3.up * 180:Vector3.zero;
    }
    }
    else {
    currentSpeed = IncrementTowards(currentSpeed, targetSpeed,slideDeceleration);
    }

    // Set amount to move
    amountToMove.x = currentSpeed;

    if (wallHolding) {
    amountToMove.x = 0;
    if (Input.GetAxisRaw("Vertical") != -1) {
    amountToMove.y = 0;
    }
    }

    amountToMove.y -= gravity * Time.deltaTime;
    playerPhysics.Move(amountToMove * Time.deltaTime, moveDirX);

    }

    void OnTriggerEnter(Collider c) {
    if (c.tag == "Checkpoint") {
    manager.SetCheckpoint(c.transform.position);
    }
    if (c.tag == "Finish") {
    manager.EndLevel();
    }
    }

    // Increase n towards target by speed
    private float IncrementTowards(float n, float target, float a) {
    if (n == target) {
    return n;
    }
    else {
    float dir = Mathf.Sign(target - n); // must n be increased or decreased to get closer to target
    n += a * Time.deltaTime * dir;
    return (dir == Mathf.Sign(target-n))? n: target; // if n has now passed target then return target, otherwise return n
    }
    }
    }
     
  43. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    I think it with this animator.SetFloat("Speed",animationSpeed); I am assuming the speed will trigger from idle state then go to run animation and vise versa yeah?
     
  44. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
  45. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    I used the blend tree to input the animations after that
     
  46. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Hmm...I see you can switch the parameter list and make it a bool and have a true and false statement to trigger the animations.
     
  47. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Or we can make a variable for the Player can keep track of its current speed.
     
  48. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Here is the cube moving up and down the ladder. This is how you want it right?
     
  49. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    Yeah, that's what I am looking for :)
     
  50. KiritoKazuto99

    KiritoKazuto99

    Joined:
    Jul 22, 2014
    Posts:
    36
    So what do I do with the new script to get the animation transition to work again?