Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] 2D Platform Controller

Discussion in 'Assets and Asset Store' started by JohnnyA, Mar 11, 2013.

  1. kerafrymm

    kerafrymm

    Joined:
    Jan 20, 2013
    Posts:
    21
    Hi JohnnyA, awesome kit you have here. I am thinking about buying this kit, but I wanted to ask you how does walljumping in this kit work? is it automatic, etc. or do you have to move your character in the air after you jump, and is there any sort of wallcling that reduces the speed as you slide down the wall?
     
  2. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Hi,

    wall jump is currently the style I am used to (hold against wall, then press the opposite direction and jump). A few people have asked for the Rayman Origins style wall jumps where you just stick to the wall and jump. You can pretty easily duplicate this behaviour by placing an auto-stick ladder next to the walls, however I do plan on making the Rayman style walls as a core function ( a checkbox in jump controls).

    The kit is very extensible (even more so with next update). To implement wall cling you could add a platform class which reduces velocity in the y direction. It's actually not a bad idea for this to be part of the core functions too , e.g. a float value between 0 and 1 where 0 = no wall cling and 1 = stick to walls.

    TLDR ... as it stands now, you could use the Platform extension mechanism to implement this with a bit of work, but I'll try and get as a core function it in the next update (1-2 weeks away).

    - John A
     
  3. kerafrymm

    kerafrymm

    Joined:
    Jan 20, 2013
    Posts:
    21
    Thanks for the quick reply man. Also, does this work with 2d toolkit or with orthello 2d?
     
  4. zebualvi

    zebualvi

    Joined:
    Apr 14, 2013
    Posts:
    11
    Hey JohnnyA, love this kit. I have a quick question, can i add my own actions in this kit? I am making an action platformer in which my main character will have a sword and a cross bow and bunch of enemies. I don't really know how to code so any help will be greatly appreciated.

    Thanks.
     
  5. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Hi zebualvi,

    glad you like it.

    The controller is a movement controller. There's no generic way to add an attack, you'll need to build something yourself to do this. You can still use the same Input class and the same Animation class, but somewhere along the line you are going to need to turn on hit boxes or shoot arrows or whatever is appropriate for your game.

    What I generally do to handle attack animations is have a value on the animation class that is true while an action is taking place. While this value is true the basic animations wont play. Alternatively in the 3D world you often want to cross fade (so you can play Jump and AttackOne at the same time).

    Regards,

    John A
     
  6. zebualvi

    zebualvi

    Joined:
    Apr 14, 2013
    Posts:
    11
    Thanks JohnnyA, though i have to admit, all of it went over my head. Another thing i noticed is that there is no death or health loss from either falling from a height or touching some object meant to respresent a pit etc. I hope its on your list of future updates.

     
  7. parnell

    parnell

    Joined:
    Jan 14, 2009
    Posts:
    206
    Thanks for the video update JohnnyA.
    Can't wait to finally get my computer setup so I can begin tinkering:)
     
  8. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    So, i have a problem with Triggers.

    Here is a Screen:
    $bildschirmfoto_2013-04-14_um_23_34_37.png

    To the left is the Prefab of your package. To the right is a simple Cube-Object, where i modified the Box Collider Size and set "Is Trigger" to TRUE.

    Obove is a normal Cube with a Rigidbody-Comp. attached.
    So. What is happening, when i start the game:

    The Little cube is falling down through the big empty cube. Of course, since the big one is a Trigger. But the CharacterPrefab doesn't go through. It handles the big empty cube just as all the other plattforms. It just ignores the "Is Trigger" Setting. I can't pass through it. I can jump on it. No OnTriggerEnter-Method is invoked. Why is that?
     
  9. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    By default raycasts hit triggers. You can turn that off in physics settings, but the recommended thing to do would be place to place your triggers in a layer that isn't used by the controller. For example the conveniently named built-in layer "Ignore Raycasts".

    - John A
     
  10. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Yeah but when i choose that layer for the cubes and my Character has the "Default" Layer than i will never enter the Trigger-State cause there are in different Layers, won't it? Well i tried that and it appeared so.
    Even if the "Is Trigger"-Setting is Unchecked, so set to FALSE, i am going through the Cube now, which clearly shouldn't happen now. So i am going through it either way because it is on a complete other layer, that way i can't react to it, Trigger or not.
     
  11. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Only kinematic rigidbodies can trigger triggers. If we used them then Unity would control the physics not us. That's what we are trying to avoid. With careful planning you can work around this (i.e. add a rigidbody not-affected by gravity on a layer that doesn't hit any other rigidbodies), but first I'd suggest using the classes that were built for this kit.

    If you want the character to trigger actions you should extend the Platform class. Platforms have various actions that trigger when the characters raycasts collide with them.

    Let me know what your specific requirement is and I'd be glad to help.

    - John A

    Edit:

    Just FYI, physics on different layers can collide with each other. There's a big table in the physics settings where you choose which layers interact. The reason you can't trigger it is because the character doesn't have a rigidbody.
     
    Last edited: Apr 15, 2013
  12. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    My Character is just the CharacterPrefab of your Package, and i just made some new Cubes by Unity itself which are basic flat plattforms with no Scripts attached.
    Then somewhere in the scene there is another simple made Cube which has only the Box Collider attached. "Is Trigger" is checked, so if the CharacterPrefab enters the Trigger something should happen. But that doesn't work.
    In Fact, i am working with PlayMaker and attached a FiniteStateMachine to that certain cube with a OnTriggerEnter-Transition, which activates the second state where some actions are made. But i already tried it via Scripts, too, didn't work either. OnCollisionEnter didn't work either when the "Is Trigger"-Setting is unchecked, what i didn't quite understand. Am i not colliding with the cubes when i jump on them or push against them?

    Extending your Plattform-Scripts? Hm, what exactly should/could I write in the scripts?

    Edit to your Edit:

    Ah! And if i just would add a Rigidbody to the CharacterPrefab and uncheck the Use of Gravity and Freeze the Rotation? Would that be a problem with this Plugin?
     
    Last edited: Apr 15, 2013
  13. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    I will try to be clearer. The controller is an alternative to Unity physics so it doesn't work with triggers. There is an abstract class called Platform which has a method called DoAction(). This is the equivalent to a trigger. You could plug this in to PlayMaker.

    To use it you write your own Platform extension, for example:

    Code (csharp):
    1.  
    2.  
    3.     using UnityEngine;
    4.     using System.Collections;
    5.      
    6.     public class ShootUpPlatform : Platform {
    7.      
    8.         public float force = 10.0f;
    9.         private bool alreadyAdded;
    10.        
    11.         override protected void DoUpdate(){
    12.             alreadyAdded = false;  
    13.         }
    14.        
    15.         override public void DoAction(RaycastCollider collider, RaycastCharacterController character) {
    16.             // Do something when this is stood on (i.e. collider direction == DOWN)
    17.             // For trigger like behaviour you don't need these checks
    18.             if (!alreadyAdded  (collider.direction == RC_Direction.DOWN) {
    19.                 character.Velocity =  new Vector2(character.Velocity.x, character.Velocity.y + force);
    20.                     alreadyAdded = true;
    21.             }
    22.         }
    23.     }
    24.  
    -----

    However if you really wanted to use triggers you can do the following:

    1. Add a collider to the character and set use gravity to false.
    2. Put the collider in a layer that that is not used by the character controller. For example layer 15, which we call character_rigidbody.
    3. Create your trigger.
    4. Put the trigger in a layer that is not used by the character controller. For example layer 16 which we call triggers.
    5. Set up the physics settings so that the collider layer (15) from step 2 only interacts with the trigger layer (16).
    6. Make sure you never put any rigidbodies in the trigger layer (16).
     
    Last edited: Apr 15, 2013
    snake77jt likes this.
  14. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    I think on the next version if you have time the Platform class could use some extra documentation / video time. I've written my own platform extensions in my game and I'm finding it incredibly useful but a bit more doc on it could probably help point out these uses and I'm always interested in looking at your code solutions.
     
  15. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    That's probably a pretty good idea, particularly because the Platform class got a whole lot more powerful this update (you will need to make some minor updates to method signatures in your existing platform code).

    Platforms can now completely override characters movement... the whole rope system is implemented as a platform.

    Thanks for the suggestion :)

    - John A
     
  16. BranDino

    BranDino

    Joined:
    Apr 12, 2013
    Posts:
    16
    Hello, I haven't purchased this kit yet, and just about to.
    A Few Questions:
    1.) If I buy it now [asset store as of today-April 17th--has Version:1.1.4 (March 28, 2013) ] , will I have to purchase the updated version to obtain the new features you are working on for the next release or will I be able to download the updated version for free? (yes, I am a noob to the store)

    2.) Does your controller include a "smooth camera follow", a camera that follows the character? If not, I have a basic java script "camera follow" working now on a basic character controller, I think I would be able to apply that script to your controller written in c#.
    Thanks!!
     
  17. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    1. All updates are included in the price.

    2. No camera controls. The focus is on the movement... making something that looks and feels like a "real" platform game. In the end its still a game object with a transform, so its likely your script will work with that. If not I'm willing to help, just ask here, in PM or via support email provided in the package.
     
  18. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Just a little bump. I've submitted ropes a long with a few other minor updates. Waiting, waiting...

    Also whats next is being updated. Due to popular demand the next features will be:

    Wall Climb/Wall Slide
    Ledge Grab/Hang
     
    Last edited: Apr 19, 2013
  19. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Do i read jetpack somewher in this thread ;)
     
  20. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Theres a jetpack script posted somewhere (not sure if its here or via PM), its really simple though just update character y velocity based on your jetpack button. Simplest place to do it would be in your input controller.

    This is untested but add something like this to Update loop of input controller:

    Code (csharp):
    1.  
    2. // Special case for jetpack
    3. if (Input.GetKey(KeyCode.LeftAlt) ) {      
    4.     myCharacter.Velocity = new Vector2( myCharacter.Velocity.x,
    5.                                 Mathf.Min(maxVelocity,
    6.                                 myCharacter.Velocity.y + jetPackForce * Mathf.Min(Time.deltaTime, RaycastCharacterController.maxFrameTime)));
    7. }
    8.  
     
  21. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Update approved, wow quick work Unity :)
     
  22. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
    Cool.

    i'm waiting for :

    Wall Climb/Wall Slide
    Ledge Grab/Hang

    Thanks ;)
     
  23. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Hm, the Update gives me this error:

    Scripts named 'SetGravity.cs' exist in multiple locations (Assets/2DPlatformController/Samples/SetGravity.cs). Please rename one of the scripts to a unique name.
    Scripts named 'SetGravity.cs' exist in multiple locations (Assets/PlayMaker/Actions/SetGravity.cs). Please rename one of the scripts to a unique name.

    Is there a chance you could rename this? For now i rename it myself, but it would be good if you'll change this in a future Update :)
     
  24. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Sure.

    -----
    Someone was asking about respawn points and kill boxes (as in the Walker Boys tutorials).

    Here's how to do it in the PlatformController:

    ReswpanPoint.cs
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. /// <summary>
    6. /// Respawn point, Platform implementation.
    7. /// </summary>
    8. public class RespawnPoint : Platform {
    9.    
    10.     /// <summary>
    11.     /// You might want to spawn in a different position to the platform,
    12.     /// for example slightly above it. Use this for that.
    13.     /// </summary>
    14.     public Vector3 respawnPositionOffset;
    15.    
    16.     /// <summary>
    17.     /// The current respawn point. This only supports one character for multiple characters
    18.     /// you could store the respawn point on the character or use a Dictionary that maps
    19.     /// characters to respawn points.
    20.     /// </summary>
    21.     private static RespawnPoint currentRespawnPoint;
    22.    
    23.     /// <summary>
    24.     /// Stand on a respawn point to activate it. You could play a particle effect of something here.
    25.     /// </summary>
    26.     override public void DoAction(RaycastCollider collider, RaycastCharacterController character) {
    27.         if (collider.direction == RC_Direction.DOWN) currentRespawnPoint = this;
    28.     }
    29.    
    30.     /// <summary>
    31.     /// Respawn the character at the given point.
    32.     /// </summary>
    33.     public static void Respawn(RaycastCharacterController character) {
    34.         if (currentRespawnPoint != null) {
    35.             character.Velocity = Vector2.zero;
    36.             character.transform.position = currentRespawnPoint.myTransform.position + currentRespawnPoint.respawnPositionOffset;
    37.         }
    38.     }
    39. }
    40.  
    KillBox.cs
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. /// <summary>
    6. /// Respawn the player when they touch this. Its a pretty simple
    7. /// implementation. In a real game you probably wont to invoke a death
    8. /// method which does all the things required for death (lives, scores,
    9. /// effects, sounds, etc)
    10. /// </summary>
    11. public class KillBox : Platform {
    12.    
    13.     /// <summary>
    14.     /// Trigger the respawn.
    15.     /// </summary>
    16.     override public void DoAction(RaycastCollider collider, RaycastCharacterController character) {
    17.         RespawnPoint.Respawn(character);
    18.     }
    19. }
    20.  
     
    Last edited: Apr 21, 2013
  25. msbranin

    msbranin

    Joined:
    Jan 19, 2009
    Posts:
    104
    Is no one else having a problem with the rope scene in the newest version of this? I import this straight into a new project and when I start this scene the flexible rope at the top is spazzing out on the very top rope link. it finally settles down but the rope is hanging off to the right at a very odd angle. the 2 bottom rope look normal but when you jump on them, they try to jump away from the player controller and if you manage to actually attach to one you can not swing them left or right and if you jump the character stays attached to the rope and the whole rope detaches from the platform it is connected to and jumps with the player and lands on its side.
     
  26. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Sounds like you have some layer problems. Empty project import is working for me, but maybe I had already messed with some of the layer settings so it wasn't a true empty project. I don't think physics settings export so I will add them in to set gravity script.

    In the mean time make sure your IgnoreRaycast layer doesn't collide with other layers (the rope0 - rope8 should be on this layer), particularly the "default" layer.

    EDIT: Also the box collider doesn't need to be on the character, it was there to demo the push feature, but would only be affecting performance now.
     
    Last edited: Apr 21, 2013
  27. ziAppi

    ziAppi

    Joined:
    Apr 22, 2013
    Posts:
    3
    Hey Johnny,

    First of all I wanted to say a big thanks for a job you've done! I've tried to implement all this behaviors on my own first and in the end I didn't come even close enough to the robustness you've achieved.

    However there's a thing I'm a bit confused about. You have CharacterState enum and send Idle, Walk etc. events according to changes in this states. Ok. But also you advice to use this events for launching corresponding animations. I've slightly modified default ModelAnimator script you've provided to log all events coming and sometimes this sequences look really odd. For example, if you stand still and simply press Jump then it looks like this:
    1. Jump
    2. Then instantly Idle (which already breaks animations if you follow this events literally, it should be still Jump instead).
    3. Then after the peak Fall.
    4. And then on hit 3 events simultaneously: Idle, Fall, Idle.

    I'm using SmoothMoves and calling two identical animations to Crossfade makes it jerk and play them without Crossfade. In my perspective it should've looked like Jump->Fall->Idle, not the sequence I've provided above :) In other cases sequences of events are "not normal" too.

    I understand that this states are there more for the character physics handling, not for animation states. Maybe it should be a good thing to add AnimationStates to this controller independent from CharacterStates? So that they'll map directly onto the animations?

    I've solved the animations problem for myself but it required adding some variables to keep track of what already happend, what was the sequence of events and so on (previousState isn't enough), not a piece of cake. And to be honest I'm worried about something changing in the physics of the character later so it'll break this sequences of events I've so patiently walked around :)

    Thanks!
     
  28. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Hi ziAppi,

    its been a while since I took a serious look at the animation code, and I can see where there are some issues; quite a few places where multiple events can be sent per frame. I'll clean it up next update, and can send you the update before approval. It should only be a few days away.

    Note that character states are only used for animations. So you wont break anything there.

    - John A
     
  29. ziAppi

    ziAppi

    Joined:
    Apr 22, 2013
    Posts:
    3
    Thanks, John, I would appreciate that. Please make sure those sequences of events make sense in animation terms: Idle->Jump->Fall->Idle and so on.

    I think it also would make sense to add Landed and Pushing events for corresponding animation states. SecondJump event might be a good idea too because second jump might be starting with a salto or something so it's usually a different animation (of course it can be tracked manually in code, not a big deal). And of course wall-related events, especially for a wall slide when it'll be ready.

    Thanks!
     
  30. parnell

    parnell

    Joined:
    Jan 14, 2009
    Posts:
    206
    Agreed.
    However, I can't wait for edge grabbing!
    Keep it up!
    B
     
  31. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Edge grabbing isn't too far away, but the bug fixes have to take precedence. The animation fixes will definitely be submitted within the week, the edge grabbing may or may not make that update.
     
  32. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Animation fix is ready for anyone who wants it. WIll give it a few days of testing before submitting.
     
  33. Mistale

    Mistale

    Joined:
    Apr 18, 2012
    Posts:
    173
    This...is...great!
    Bought it and have absolutely no regrets. I love your programming style, very clean and effective!

    Can't wait to see future improvements on this asset (as if it's wasn't great already).
     
  34. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    Looks good, Does it work with Smooth Moves?
     
  35. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    It sends animation events which can be integrated with any animation system. It includes a couple of samples. Several people are using with smooth moves and a few pages back you can see some smooth moves sample code.
     
  36. ziAppi

    ziAppi

    Joined:
    Apr 22, 2013
    Posts:
    3
    I'm using it with SmoothMoves and it's as simple as subscribing for event and triggering an animation based on event's state variable. Very easy to setup (especially with the latest update).
     
  37. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Hi all, animation updated submitted and already approved. Go Unity!

    - John A
     
  38. msbranin

    msbranin

    Joined:
    Jan 19, 2009
    Posts:
    104
    Ropes are working correctly now as well since this new update.
     
  39. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    I added the physics set up to a script called SetUpPhysics so you don't need to do it yourself.
     
  40. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Just a little bump, hope the animation stuff is working out well for everyone. Let me know if you need a hand upgrading.
     
  41. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    I updated the version and the Robotsample looks weird in the Scene. If i hit Play it's a nearly empty scene, the character isn't displayed, only a tiny something...is this intended?

    I also get some Warnings about CharacterStates and "myTarget" is never used.
     
  42. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    RobotSample isn't in the new package. It was accidentally included in the old one but since removed. Its probably still a hang around from your previous project?

    The warning are probably to do with that as well.

    You will get one warning in Joystick.cs if you load in Unity 4.x as as GameObject.active is used to ensure support for Unity 3.5.x.
     
  43. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    I bought this for my platform game. Looking forward to the ledge hang implementation. Any ETA on it?

    Also, will you allow the character to climb on to the ledge (like in the game Limbo) or pull themselves up like a jump? Personally I'd like the like to see the climb on to ledge, like in limbo.
     
  44. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Hi Derkoi, you can do probably climbing along a ledge with the current passthrough platforms and the platform extension mechanism. Is that what you mean by Limbo style?

    Something like this should do the trick:

    Code (csharp):
    1.  
    2. public class PassthroughPlatformLedgeClimb : Platform {
    3.    
    4.     public float fallThroughTime = 1.5f;
    5.    
    6.     override public bool overrideY {get {return true;} }
    7.     override public bool overrideAnimation {get {return true;} }
    8.    
    9.     override public void DoAction(RaycastCollider collider, RaycastCharacterController character) {
    10.         character.SetDrag(1.6f);
    11.         if (collider.direction == RC_Direction.DOWN  character.characterInput.y < 0.0f) {
    12.             character.FallThroughTimer = fallThroughTime;
    13.             character.Velocity = new Vector2(0.0f, -5.25f);
    14.         } else if (collider.direction == RC_Direction.DOWN  character.characterInput.y > 0.0f) {
    15.             character.Velocity = new Vector2(0.0f, 5.25f); 
    16.         }
    17.     }
    18.  
    19.     override public Transform ParentOnStand(RaycastCharacterController character) {
    20.         if (character.FallThroughTimer <= 0.0f) return myTransform;
    21.         return null;
    22.     }
    23.    
    24.     override public CharacterState GetAnimationState() {
    25.                 // This is a new state, you would need to add it to the animation list
    26.         return CharacterState.LEDGE_HANGING;
    27.     }
    28.    
    29. }
    30.  
    Then set up two passthrough platforms, one above the other, with that script attached to the bottom platform. Its a bit rough 'n' ready with magic numbers and the like, but it does the trick.

    Quick video of it in action:

    [video=youtube_share;-euKAcQ6TMw]http://youtu.be/-euKAcQ6TMw

    What I am planning to add is the prince of persia (and a million other game) style thing where you miss a jump and just grab it with your hands. This one is a bit harder to achieve with the current set-up and its also something you want to have "everywhere".

    - John A
     
    Last edited: Apr 25, 2013
  45. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    Thanks for the example. I was referring to the "prince of persia" style jump and grab the ledge though.
     
  46. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Ahh okay, well that is "coming soon". Haven't had much time this week, but maybe over the weekend I will get a chance at it, I have a pretty good idea of how I'm going to do it. Just need to write the code :)

    - John A
     
  47. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Yeah, i deleted the Robotsample-Folder and the issue was gone, but this one remained:


    @Topic:

    Wow, I am looking forward to the new features :D
    Keep up the good work.
     
  48. parnell

    parnell

    Joined:
    Jan 14, 2009
    Posts:
    206
    Ha that's awesome JohnnyA! I was thinking the edge hang was more of a prince of persia thing as well, but damn this is great too! Would there be an animation call that'd need to happen in this instance? If so is it already in the controller or will we need to write up a call for it?
    Great work man.
    Thanks
    B
     
  49. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Howdy Parnell,

    Prince of Persia edge hang is what I meant, and thats what I will be implementing.

    The above was more of a sample of what you can do with the Platform class.

    The override public CharacterState GetAnimationState() will set the right animation, but the LEDGE_HANGING state was made up. You would need to edit CharacterState and add the LEDGE_HANGING state to the enum (preferably with a reasonably high override number).
     
  50. parnell

    parnell

    Joined:
    Jan 14, 2009
    Posts:
    206
    Hi JohnnyA!
    I finally had some serious time to sit down with this.
    I played with the controller tonight with my own 3D character/anims. Very easy to setup for the most part. However, I noticed that when I press right the character controller would move right but the animation would show him running left. Same goes for pressing left. I 'fixed' this by swapping the < > in the checkdirection. i'm worried that no one else has mentioned this problem but I know these animations/character work just fine with other controllers. Also, I noticed when the scene was facing 'front' the actual camera and scene were reversed at run time. One last note, when increasing the walkspeed, or runspeed the controller moves faster but the actual speed of the animation seems to keep the same rate. When making 3rd person controllers I was able to actually speed up the animation instead of just moving the controller faster. Is this possible, and if so how is the proper way to make that happen?

    Thanks in advance.
    B