Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Released] 2D Platform Controller

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

  1. The_Daleatron

    The_Daleatron

    Joined:
    Nov 26, 2013
    Posts:
    43
    Sounds awesome john, il just wait till the update whilst my build my other assets. That sounds alot like what i was looking for, it would be nice to have a class up for jump up directly and jump + direction for a directional jump, As in Abe's Odyssey style of platformer game. But your doing already sounds awesome.
     
  2. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Remember you can always check Velocity too. Its exposed primarily for this reason.
     
  3. AMO_Noot

    AMO_Noot

    Joined:
    Aug 14, 2012
    Posts:
    431
    Can't wait!
     
  4. Mad_Fox

    Mad_Fox

    Joined:
    May 27, 2013
    Posts:
    49
    Hi Johnny, i've encountered a simple problem, when my character is crouchsliding below something and you press jump, it jumps, stop the sliding and the character stays on foot with the head stuck in the geometry (you can still walk). (i've tried in your sample with crouch and it does the same), how can i disable jump when im crouch sliding below something? I know how to override some commands with the "character state" of the controller but your code is more simple and correct and i dont want to mess my input script, Thanks again!
     
  5. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Although you could override move in the input thats a workaround for a bug, you shouldn't be able to jump in that situation. If you don't ever need to jump while crouch sliding:

    Find this:

    // Jump
    if (!hasHitHead || isClimbing) {

    and make it:

    // Jump
    if (!isCrouchSliding (!hasHitHead || isClimbing)) {


    That is untested as I'm in the middle of major overhaul but I think that should do the trick.

    If not let me know.
     
  6. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    JohnnyA,

    just thought I'd throw out some encouragement! Keep up the great work on the package!!! I imagine it's a very tough job supporiting 3 assets on top of a day job and your new fatherly duties and I think everyone really appreciates the quality of your work as well as your constant presence on this forum.

    Looking forward to v2.0!

    You rock!!!
     
  7. Mad_Fox

    Mad_Fox

    Joined:
    May 27, 2013
    Posts:
    49
    Thanks! you pointed me in the right direction, i still wanted to jump when crouchsliding in open space so i have added a simple private bool variable to point me when the character is hitting head when crouch sliding and used that to stop the jumping.
     
  8. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Sure, I'd usually provide a proper solution via a patch but given the changes that are going on at the moment, I will hold off on that.

    @TheValar Thank you ... I'm on break from the day job for another few weeks which is easing the transition, even then I'm still walking around like a zombie due to lack of sleep :)
     
  9. msbranin

    msbranin

    Joined:
    Jan 19, 2009
    Posts:
    104
    well the good news is that zombie stuff eases up as the baby gets a little bit older.. say 17-18.
     
  10. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Hah I can only dream.

    - - - -

    In other news, I stopped designing and started writing code for the v2 update yesterday. Bit behind schedule but I took another week off of work so hopefully it will still be delivered roughly on time.
     
  11. Gigaloth

    Gigaloth

    Joined:
    Nov 25, 2013
    Posts:
    7
    Hey Johnny, I've gone through about ten pages here and haven't seen anything addressing the question I have, so I thought Id post. I've built a small "level", which is basically just a few rectangle and square sprites with box colliders. I put the prefabbed alien in the scene and he interacts fine with the sprites, but I was trying to add some enemy scripting to another sprite, nothing special, just trying to see how it works. The problem is that the ray casting isnt working for the object I created, the sprite just falls through the level. Any thoughts on why this might be happening?
     
  12. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    HI Gigaloth,

    which enemy scripts are you using? Did you create a prefab from the sample in the scene and then drop it into your game? If not there are quite a few settings in there. Are colliders configured? Are layers assigned correctly? Z axis aligned?

    In the end the Extra Features stuff is a bit all over the place, it works, but its not made with ease-of-use in mind. Its basically a bunch of quick examples and was never really intended to be part of the core product, thats something that will change in version 2. Everything included will get the same attention as the controller itself.

    Still if you give more details I should be able to get you on track (email is gernally better for details BTW).

    - - - --
    For everyone else here's a version 2 Update:

    Firstly the package will now be called Platfomer Pro. I wanted to remove 2D so I don't scare away people who are doing 2.5D and I wanted to remove controller because the package will now be a complete kit. I'm still open to name suggestions.

    Progress is still limping. I will not sacrifice on quality so if it takes longer it takes longer. Worse case if it is really dragging on I'll do another release in the 1.9.x stream to address any pressing concerns and keep you guys off my back :)

    I'll post some screenshots soon about the new process for configuring your character. It's all based on custom editors and instead of a million and one settings you now have drop down boxes which then provide context sensitive options. For example if you select DIGITAL ground movement you only have one variable to enter, SPEED, and thats it. If you choose a PHYSICS jump movement you have two variables, FORCE and GRAVITY, thats it.

    For more advanced coders the code is very modular... everything I am writing is written with the same process that you would use to write your extensions. Those drop downs mentioned earlier use reflection to pick up any modules you write and they become first class citizens.

    Anyways, I'll try to get some pretty pictures in a few days and a video in a week or so.

    Cheers,

    John A
     
  13. The_Daleatron

    The_Daleatron

    Joined:
    Nov 26, 2013
    Posts:
    43
    :D sounds great, im all excited now !
     
  14. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    301
    Anyone had any experience combining this with 2D toolkit tilemapper ?

    I tried, but i can't get the character to collide with the layers from 2D toolkit, even switched the various layers out to match
    this asset. but It simply refuses to collide. :(
     
  15. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Several users are using with 2D Toolkit TileMapper without issue, including me, for example here: http://www.kongregate.com/games/jnamobile/sorlo-by-two-pre-alpha

    Although my usage is old and thus not 2D, some users are definitely using with the newer 2D collider version of 2D ToolKit tilemaps.

    Really the only thing that should need to be setup is the game object layers and if you are using 2D colliders ensure you are using the 2D version of the control classes.

    Ledges and ladders require a little more tweaking (ledges are expected to be boxes so you need to create prefabs for your tiles, similarly for ladders).
     
    Last edited: Jan 11, 2014
  16. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    By the way given your name matches the latest reviewer you might have been looking for an alternaitve input. Here's a Unity control system based input class:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. /// <summary>
    6. /// A  character input using Unity input.
    7. /// </summary>
    8. public class UnityInputInput : RaycastCharacterInput
    9. {
    10.  
    11.     /// <summary>
    12.     /// IF true always run.
    13.     /// </summary>
    14.     public bool alwaysRun;
    15.  
    16.     /// <summary>
    17.     /// If true dropping from a passthrough platform requires user to press down and then jump.
    18.     /// </summary>
    19.     public bool jumpAndDownForDrop;
    20.  
    21.     private int movingDirection;
    22.  
    23.     void Update ()
    24.     {
    25.        
    26.         if (Input.GetButton("Restart")) {
    27.             Application.LoadLevel(0);
    28.         }
    29.        
    30.         jumpButtonHeld = false;
    31.         jumpButtonDown = false;
    32.         dropFromPlatform = false;
    33.         x = 0;
    34.         y = 0;
    35.  
    36.         x = Input.GetAxis("Horizontal");
    37.         y = Input.GetAxis("Vertical");
    38.         // Force y to use discrete values
    39.         if (y > 0) y = 1;
    40.         if (y < 0) y = -1;
    41.  
    42.         // Run
    43.         if (alwaysRun || Input.GetButton("Run")) {
    44.             x *= 2;
    45.         }
    46.         if (y == -1  !jumpAndDownForDrop) dropFromPlatform = true;
    47.  
    48.         if (Input.GetButton("Jump")) {
    49.             jumpButtonHeld = true;
    50.             if (Input.GetButtonDown("Jump")) {
    51.                 if (jumpAndDownForDrop  y == -1) {
    52.                     dropFromPlatform = true;
    53.                 } else {
    54.                     jumpButtonDown = true; 
    55.                 }
    56.                 swimButtonDown = true; 
    57.             } else {
    58.                 jumpButtonDown = false;    
    59.                 swimButtonDown = false;
    60.             }
    61.         } else {
    62.             jumpButtonDown = false;
    63.             swimButtonDown = false;
    64.         }
    65.     }
    66.    
    67. }
    68.  
    (you will need to create a Jump, Run, and Restart input in the Unity input setting screen).

    The kit was originally written for coders and was intended only to be a character controller only which is why some of the other stuff requires coding. The idea was that you would be plugin in third party assets and custom systems.

    That will change in v2 where the controller officially becomes a kit.
     
    Last edited: Jan 11, 2014
  17. AdrianST

    AdrianST

    Joined:
    Jan 7, 2014
    Posts:
    18
    Is there any way to make the character rise and fall faster when jumping? It doesn't seem like fall velocity is doing anything.

    I'd also like to limit the characters air movement so he can't turn around in the air, and can only control his momentum slightly.

    In the meantime I'll look through the code and try and help myself, but any pointers would be appreciated.
     
  18. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    That variable is just an animation control (yes, its poorly named):

    Code (csharp):
    1.  
    2.     /// <summary>
    3.     /// The velocity required before the fall event replaces the airbourne event (negative number).
    4.     /// </summary>
    5.     public float fallVelocity = -1.0f;
    6.     /// <summary>
    7.  
    What you are looking for is:

    Code (csharp):
    1.  
    2.     /// <summary>
    3.     /// The terminal velocity in the y direction.
    4.     /// WARNING: If this is too large you will be able to fall through platforms. Make sure maxframeTime * terminalVelcoty < feetCollider.distance.
    5.     /// </summary>
    6.     public float terminalVelocity = -12.0f;
    7.  
    The other thing that affects the speed is Physics.gravity (it provides the acceleration).

    For limiting the affect of movement make sure you are using physics like movement setting and then adjust the value of x passed in by your input controller if you aren't grounded.

    For example a quick fix would be to add something like this to your input class:
    Code (csharp):
    1.  
    2. if (character.IsGrounded) {
    3.   x *= 0.25f;
    4. }
    5.  
    - - - - -

    PS a lot of these things are addressed in the new controller. Been working on some jump editor GUI today. It should be a lot simpler to get what you want :)
     
  19. AdrianST

    AdrianST

    Joined:
    Jan 7, 2014
    Posts:
    18
    Thanks for the help, was exactly what I wanted. Feels a lot better now!
     
  20. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Awesome :)
     
  21. Infectedspleen

    Infectedspleen

    Joined:
    Jan 12, 2014
    Posts:
    7
    Hi There,

    Im trying to get the OUYA controller to work with your SimpleCharacterInput.cs Script But I'm having problems. One being that I'm new to coding. Ive managed to get the jump function to work with the OUYA controller buttons, But i can't get the movement of the character to work with the left axis.

    Heres the code.

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. /// <summary>
    5. /// A simple character input. Arrows to move, left SHIFT to run, SPACE to jump.
    6. /// </summary>
    7. public class SimpleCharacterInput : RaycastCharacterInput
    8. {
    9.  
    10.     /// <summary>
    11.     /// IF true always run.
    12.     /// </summary>
    13.     public bool alwaysRun;
    14.  
    15.     /// <summary>
    16.     /// If true dropping from a passthrough platform requires user to press down and then jump.
    17.     /// </summary>
    18.     public bool jumpAndDownForDrop;
    19.  
    20.     private int movingDirection;
    21.  
    22.     public bool continuousScan = true;
    23.     public OuyaPlayer player = OuyaPlayer.P01;
    24.  
    25.     // Use this for initialization
    26.     void Start () {
    27.    
    28.         OuyaInput.SetContinuousScanning(continuousScan);
    29.         OuyaInput.UpdateControllers();
    30.     }
    31.  
    32.  
    33.     void Update ()
    34.     {
    35.        
    36.         if (Input.GetKey(KeyCode.R)) {
    37.             Application.LoadLevel(0);
    38.         }
    39.        
    40.         jumpButtonHeld = false;
    41.         jumpButtonDown = false;
    42.         dropFromPlatform = false;
    43.         x = 0;
    44.         y = 0;
    45.        
    46.         if (Input.GetKey("right")   !Input.GetKey("left") || OuyaInput.GetAxis(OuyaAxis.LX, OuyaPlayer.P01)) {
    47.             x = 0.5f;
    48.             movingDirection = 1;
    49.         } else if (Input.GetKey("left")  !Input.GetKey("right") || OuyaInput.GetAxis(OuyaAxis.LX, OuyaPlayer.P01)) {
    50.             x = -0.5f;
    51.             movingDirection = -1;
    52.         } else if (Input.GetKey("right")  Input.GetKey("left") || OuyaInput.GetAxis(OuyaAxis.LX, OuyaPlayer.P01)) {
    53.             x = movingDirection / 2.0f;
    54.         }
    55.        
    56.         // Shift to run
    57.         if (alwaysRun || Input.GetKey(KeyCode.LeftShift)) {
    58.             x *= 2;
    59.         }
    60.        
    61.         if (Input.GetKey("up") ) {
    62.             y = 1;
    63.         } else if (Input.GetKey("down")) {
    64.             y = -1;
    65.             if (!jumpAndDownForDrop) dropFromPlatform = true;
    66.         }
    67.        
    68.         if (Input.GetKey(KeyCode.Space) || OuyaInput.GetButtonDown(OuyaButton.U, OuyaPlayer.P01) || OuyaInput.GetButtonDown(OuyaButton.A, OuyaPlayer.P01) || OuyaInput.GetButtonDown(OuyaButton.O, OuyaPlayer.P01) || OuyaInput.GetButtonDown(OuyaButton.Y, OuyaPlayer.P01))  {
    69.             jumpButtonHeld = true;
    70.             if (Input.GetKeyDown(KeyCode.Space) || OuyaInput.GetButtonDown(OuyaButton.U, OuyaPlayer.P01) || OuyaInput.GetButtonDown(OuyaButton.A, OuyaPlayer.P01)|| OuyaInput.GetButtonDown(OuyaButton.O, OuyaPlayer.P01) || OuyaInput.GetButtonDown(OuyaButton.Y, OuyaPlayer.P01)) {
    71.                 if (jumpAndDownForDrop  Input.GetKey("down")) {
    72.                     dropFromPlatform = true;
    73.                 } else {
    74.                     jumpButtonDown = true; 
    75.                 }
    76.                 swimButtonDown = true; 
    77.             } else {
    78.                 jumpButtonDown = false;    
    79.                 swimButtonDown = false;
    80.             }
    81.         } else {
    82.             jumpButtonDown = false;
    83.             swimButtonDown = false;
    84.         }
    85.     }
    86.    
    87. }
    I get three errors saying SimpleCharacterInput.cs(46,27): error CS0019: Operator `||' cannot be applied to operands of type `bool' and `float'

    Is there another way i can get the character move and use || OuyaInput.GetAxis(OuyaAxis.LX, OuyaPlayer.P01


    Many Thanks
     
  22. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Code (csharp):
    1.  
    2.  if (Input.GetKey("right")   !Input.GetKey("left") || (OuyaInput.GetAxis(OuyaAxis.LX, OuyaPlayer.P01)  > THRESHOLD)) {
    3.  
    4.             x = 0.5f;
    5.  
    6.             movingDirection = 1;
    7.  
    8.         } else if (Input.GetKey("left")  !Input.GetKey("right") || (OuyaInput.GetAxis(OuyaAxis.LX, OuyaPlayer.P01) < -THRESHOLD)) {
    9.  
    10.             x = -0.5f;
    11.  
    12.             movingDirection = -1;
    13.  
    14.         }
    15.  
    where THRESHOLD is some const float you determine (maybe start with THRESHOLD = 0.25f).

    Alternatively if you wnat analogue movement just do:
    Code (csharp):
    1.  
    2. x = OuyaInput.GetAxis(OuyaAxis.LX, OuyaPlayer.P01);
    3.  
     
  23. Infectedspleen

    Infectedspleen

    Joined:
    Jan 12, 2014
    Posts:
    7
    Thank you JohnnyA, this worked a treat. I will sleep soundly tonight.
     
  24. AMO_Noot

    AMO_Noot

    Joined:
    Aug 14, 2012
    Posts:
    431
    Johnny,

    Is there a function I can call to completely stop the character controller where it currently stands, negating any remaining inertia?

    I ask because in my project, I can freeze the character controller in events, but upon unfreezing the transform, the character continues walking forward in the slide.
     
  25. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    character.Velocity = Vector2.zero;
     
  26. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Still moving very slow on v2 but here's a little shap shot of the editor in v2.0:

    $Screen shot 2014-01-15 at 10.11.00 AM.png

    Each movement has a type selector at the top. Choosing a type gives you a small explanation and shows the properties required for that movement.

    Some movements have a details section. For example in the Air Movement - Digital you can change the relative gravity applied during jump and fall (this allows you to get that mario like jump where you jump "slower" than you fall).

    - - - -
    So why is it moving so slowly...

    1. Had a favoured client who needed some work done. This took a few days from my schedule.

    2. Writing the editors in a way that allows new movements to be easily integrated. Went through a few rewrites before settling on the current system.

    3. Perfecting movement... this is where most of the time has gone. In the current version you can get good movement, but you have to tweak things a lot to your specific scenario. It also enforces rules on geometry, etc.

    I wanted to avoid all those obscure modifiers and constants in the new version. There may be a couple that sneak in, but even then I want the system to be able to decide the value, as a user you should almost never need them (and you wont see them unless you open an advanced settings window).

    I've got a near perfect digital movement now, and it doesn't require any configuration other than filling in the settings you can see in the image above.
     
    Last edited: Jan 14, 2014
  27. AdrianST

    AdrianST

    Joined:
    Jan 7, 2014
    Posts:
    18
    Forgive me for my late follow-up question, but how would I reference IsGrounded from my character? Would I use GetComponent?
     
  28. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Any way you can :)

    You can get the character refernce in your input either as a public variable assigned in the inspector or a private variable assigned at Start() using GetComponent().
     
  29. AdrianST

    AdrianST

    Joined:
    Jan 7, 2014
    Posts:
    18
    Thanks for the reply. I've tried the first method like so:

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. /// <summary>
    5. /// A simple character input. Arrows to move, left SHIFT to run, SPACE to jump.
    6. /// </summary>
    7. public class SimpleCharacterInput : RaycastCharacterInput
    8. {
    9.  
    10.     /// <summary>
    11.     /// IF true always run.
    12.     /// </summary>
    13.     public bool alwaysRun;
    14.     public RaycastCharacterController character;
    15.  
    16.     /// <summary>
    17.     /// If true dropping from a passthrough platform requires user to press down and then jump.
    18.     /// </summary>
    19.     public bool jumpAndDownForDrop;
    20.  
    21.     private int movingDirection;
    22.     void Update ()
    23.     {
    24.        
    25.         if (Input.GetKey(KeyCode.R)) {
    26.             Application.LoadLevel(0);
    27.         }
    28.        
    29.         jumpButtonHeld = false;
    30.         jumpButtonDown = false;
    31.         dropFromPlatform = false;
    32.         x = 0;
    33.         y = 0;
    34.        
    35.         if (Input.GetKey("right")  !Input.GetKey("left")) {
    36.             x = 0.5f;
    37.             movingDirection = 1;
    38.         } else if (Input.GetKey("left")  !Input.GetKey("right")) {
    39.             x = -0.5f;
    40.             movingDirection = -1;
    41.         } else if (Input.GetKey("right")  Input.GetKey("left")){
    42.             x = movingDirection / 2.0f;
    43.         }
    44.    
    45.         // Shift to run
    46.         if (alwaysRun || Input.GetKey(KeyCode.LeftShift)) {
    47.             x *= 2;
    48.         }
    49.        
    50.         if (Input.GetKey("up") ) {
    51.             y = 1;
    52.         } else if (Input.GetKey("down") ) {
    53.             y = -1;
    54.             if (!jumpAndDownForDrop) dropFromPlatform = true;
    55.         }
    56.        
    57.         if (Input.GetKey(KeyCode.Space) ) {
    58.             jumpButtonHeld = true;
    59.             if (Input.GetKeyDown(KeyCode.Space)) {
    60.                 if (jumpAndDownForDrop  Input.GetKey("down")) {
    61.                     dropFromPlatform = true;
    62.                 } else {
    63.                     jumpButtonDown = true; 
    64.                 }
    65.                 swimButtonDown = true; 
    66.             } else {
    67.                 jumpButtonDown = false;    
    68.                 swimButtonDown = false;
    69.             }
    70.         } else {
    71.             jumpButtonDown = false;
    72.             swimButtonDown = false;
    73.         }
    74.             if (character.IsGrounded = false); {
    75.            
    76.             x *= 0.25f;
    77.  
    78.         }
    79.     }
    80. }
    81.  
    I feel completely ignorant on this subject, but its not how this seems to work. Doing it this way turns it into a "group method." And therefore not a variable Unity recognizes. Sorry for the beginner programmer questions but I'm studying this asset in hopes of learning.
     
  30. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Sorry I was going off of memory IsGrounded is a method with the following signature:
    Code (csharp):
    1.  
    2. /// <summary>
    3.     /// Determines whether this character is grounded.
    4.     /// </summary>
    5.     /// <returns>
    6.     /// <c>true</c> if this instance is grounded; otherwise, <c>false</c>.
    7.     /// </returns>
    8.     /// <param name='offset'>
    9.     /// How much to look ahead from the feet colliders when determining if the character is grounded.
    10.     /// </param>
    11.     public bool IsGrounded(float offset, bool includeClimables = true)
    12.  
    So you can do:

    IsGrounded(0.0f)

    or if you want a ltitle more leeway

    IsGrounded(0.25f) - or whatever value you desire.

    You can also use:

    GroundedFeetCount > 0
     
    Last edited: Jan 15, 2014
  31. AdrianST

    AdrianST

    Joined:
    Jan 7, 2014
    Posts:
    18
    Thank you very much. I didn't even know bools could be used like that. I actually learned something. Appreciate the support, great work on the asset I love how customizable it is.
     
  32. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    No problems, have fun :)
     
  33. Gigaloth

    Gigaloth

    Joined:
    Nov 25, 2013
    Posts:
    7
    Hey Johnny, quick question (maybe you are addressing this in the next version):

    Currently, when the character is on a slope, they match the angle of the slope as they run up it. How do you get the effect that most platformers have (mario, for example) where the character remains upright on slopes? Is this is the Raycast script or the Unity2DSpriteAnimator script?

    Also, another quick question...probably an easy fix but we're just now getting more comfortable with Unity. We used the 2D animator to create our character animations, the problem is this: when the character faces to the right, it is correct. When they face left, however, the sprite is offset incorrectly about 120 pixels to the right of the ACTUAL character location (hitbox).

    I am fairly certain this is because of the arrangement of the sprites on the spritesheet, as they are not all centered in their respective sprite boxes which causes an incorrect "flipping" by the engine. Is there an easy way to offset the character sprite a certain number of pixels when the character is facing left?

    Thanks so much! This controller has been a life saver. :)
     
  34. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Gigalith, the sprite is usually a child of the main controller. Add a script that sets the sprite objects rotation back to 0 in late update (and make sure this executes after the main script). Its a one liner in late update ... transform.rotation = Quaternion.identity;

    For two I'm a little unclear... why not change the centre point of your sprite in Unity 2D? Its not that you couldn't add a direction checker that moves you the appropriate number of pixels left or right, but you would also then need to flip colliders, etc. It seems like a much more elegant solution would be to set the centres correctly.

    PS Sorry if replies are a bit brief, had a busy day, let me know if you need more detail.
     
  35. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Can't wait for v 2.0, I'm waiting to integrate this into my current project until it's done. That being said I appreciate you taking your time and making this awesome. I don't mind waiting a couple extra weeks at all
     
  36. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    I'll probably release a WIP version to those current customers who are interested first. Let me know if you are :)
     
  37. StonePaleAle

    StonePaleAle

    Joined:
    Aug 20, 2012
    Posts:
    28
    I am interested. That would be great. Should we shoot you an email?
     
  38. AMO_Noot

    AMO_Noot

    Joined:
    Aug 14, 2012
    Posts:
    431
    Hey John,

    I seem to be having issues with the Walljump Tag function: I seem unable to wall-jump off of anything,
    even when the object has the appropriate tag. Also, in 2.0, do you think you could make it so that Wall-sliding is tied to the wall-jump tag as well?

    Looking very forward to the new version, even though I'm extremely happy with the movement I have now; the modularity will make adding stuff/updating the core code a lot easier.
     
    Last edited: Jan 18, 2014
  39. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Yes email will be best as its easier to track, please include your order number.
     
  40. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    In general or just in your game? Is the wall still in the right layer? Nothing obvious like a space type in to the tag name in your character settings?
     
  41. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Last edited: Jan 19, 2014
  42. Sirz2u

    Sirz2u

    Joined:
    Sep 11, 2013
    Posts:
    1
    I took a look at 2D Platform Controller, and it seems pretty nice. What's the timeline on Platformer PRO? I'd rather not invest time and money into 2D Platform Controller if Platformer PRO is on the horizon. Will there be anything reusable between 2D PC and PRO?

    Edit: Will this package be free if we already own 2D Platform Controller?
     
    Last edited: Jan 19, 2014
  43. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    2D Platform Controller will become Platformer PRO in the asset store. SO yes it will be 'free' if you already have purchased 2DPC.

    The underlying concepts are the same, but the way they are implmented is quite different. There wont be any automatic way to migrate a project from one to the other.

    The time line is fluid, I was hoping to be done soon, but its likely still a while away. The beta will be made available to existing 2DPC owners in the next few weeks.

    - John A
     
    Last edited: Jan 19, 2014
  44. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Mobile users will be pleased to note ... v2 has no allocation (at the minor usability sacrifice of using layers instead of tags).

    I'll try and ensure this stays true for all the capabilities, although I expect along the way there may be a few where this isn't the case.

    (The on mouse stuff is the Unity editor)
     

    Attached Files:

    Last edited: Jan 19, 2014
  45. sirius_002

    sirius_002

    Joined:
    Aug 16, 2012
    Posts:
    65
    Could you add a module to Platformer Pro for Rockman style shooting ?
     
  46. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Ahh no idea what rockman is, but I guess I can google it and take a look.
     
  47. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    A look at platforms and triggers:

    [video=youtube_share;Ly071isZG0A]http://youtu.be/Ly071isZG0A​
     
  48. parnell

    parnell

    Joined:
    Jan 14, 2009
    Posts:
    206
    Hi Johnny!
    Looking great.
    By "Rockman" they are most likely referring to Mega Man.
    Keep it up!
    B
     
  49. sirius_002

    sirius_002

    Joined:
    Aug 16, 2012
    Posts:
    65
    Thank you and sorry, yes I was referring to Mega Man.
     
  50. AMO_Noot

    AMO_Noot

    Joined:
    Aug 14, 2012
    Posts:
    431
    Looking great, Johnny!

    Very interested in the beta; how feature complete would it be at that point in development? Would the modularity of it be complete (so we might begin adding our own additions and scripts to it?)