Search Unity

[Released] Smart 2D Colliders ( including Smart Platform Controller )

Discussion in 'Assets and Asset Store' started by CreativeSpore, Oct 15, 2015.

  1. henkesky

    henkesky

    Joined:
    May 23, 2015
    Posts:
    36
    Sorry @CreativeSpore i have solved it. The camera was behind the player because of the z-axis value. The problem am facing now is the climbing ability. The player seems to continue the climbing animation while still the lower body is still within the ladder trigger. I expected to see provision for something like finish climbing animation. Which should be played while the players head gets to the peak/highest level of the ladder. Am also thinking if it will be possible to rotate the player before it starts playing the climbing animation, then set it back to initial rotation, after climbing. I attached an image to illustrate the problem am facing. It does look good at all. Please how do we fix this ?
     

    Attached Files:

  2. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Check in this part of the code where it detects the climbing colliders above and below. Maybe what you need is to change the animation when there is no collider above.
    upload_2019-1-3_12-37-56.png
     
  3. Platoniax

    Platoniax

    Joined:
    Mar 22, 2015
    Posts:
    2
    Hi! The ladders seems to be not working when my character has dynamic rigidbody. The gravity is pushing my character down. Is there any workaround for ladders and dynamic rigidbodies?
     
  4. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    In the Smart Platform Controller the gravity scale is set to 0 when the player is in a ladder:
    upload_2019-3-5_21-12-59.png
    And restored when you leave the ladder.
     
  5. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    159
    @CreativeSpore Hi, I'm following the YouTube video tutorial and when I add the Smart Platform Controller to my GameObject it doesn't add the SmartRectCollider2D as in the video...

    Is this due to version difference or am I doing something wrong?

    This is the video:
     
  6. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    159
    @CreativeSpore Sorry to ask, can't figure out... what's the difference between the "SmartPlatformController" and the "PlatformCharacterController" ?
     
  7. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    159
    Ok I think I found it:

     
  8. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    159
    @CreativeSpore Hi, I'm now working with the PlatformCharacterController and found that the falling speed from a platform is different to the falling speed from the jump... any way to make them the same? Thanks
     
  9. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Did you try to change the values of Acceleration, speed and drag until Max reachable speed and time to reach max speed were the same?

    upload_2019-9-11_21-2-13.png
     
  10. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    159
    @CreativeSpore Will check that out.

    On another hand, I'm trying to implement some horizontal speed multiplier so I added a new public float for that in the PlatformCharacterController.cs it doesn't appear in the editor inspector variables.

    Code (CSharp):
    1.         [Header("Mobile Horizontal controls")]
    2.         public float HorSpeedMultiplier = 1.5f;
    And I checked the Editor file for the class and I don't find any place that could be resetting all the serialized field, but I don't understand why this new public field doesn't appear.

    Any clue what could that be?

    Thanks.

    UPDATE: found out that I have to explicitly add the field using
    Code (CSharp):
    1.  
    2. EditorGUILayout.PropertyField(serializedObject.FindProperty("SomeFieldHere"), true);
    3.  
     
    CreativeSpore likes this.
  11. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    159
    @CreativeSpore In the end I understood how to change the values for Airborne Acc and Walking Acc to achieve the speed I wanted.
     
    CreativeSpore likes this.
  12. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    159
    @CreativeSpore Hi, is there a way to visually debug the colliders on runtime? I'm having triggers out of thin air, meaning that my player is nowhere near an enemy and a kill collision is detected. What would be the best way to add an image to the colliders to be shown at runtime as debug?

    Thanks.
     
  13. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    You can see the colliders in the Game View if you enable Gizmos or in the Scene View if you press this button:
    upload_2019-10-17_19-24-8.png
     
    esteban16108 likes this.
  14. YellowMelon

    YellowMelon

    Joined:
    Nov 13, 2019
    Posts:
    1
    Hey, I'm having trouble with the trigger boxes and springboards. For the trigger boxes, the player would just stand on top of it when it shouldn't and the springboards only want to work half the time.
     
  15. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    For the springs, try using FixedUpdate mode or set Sync On to stabilize the frame time:
    upload_2019-11-16_10-19-16.png

    About the trigger boxes, what boxes do you mean?
     
  16. KrisGungrounds

    KrisGungrounds

    Joined:
    Aug 20, 2019
    Posts:
    14
    Hi, I am wondering if I will be able to use jumping and platforming if Rigidbody is kinematic?

    Also, I was expecting that the player's falling speed increases while falling, but this is not the case. From what I see Unity gravity system is handling this, but it is very strange that the fall speed doesn't increase over time.
     
    Last edited: Dec 29, 2022
  17. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    You can use this with isKinematic, but you need to set the gravity your self.
    While falling, there is a resistance (air resistance) that will make it fall at max speed after a while (terminal velocity).
    Drag value in the physic body is affecting this value.
    You can see the max reachable speed here: