Search Unity

[RELEASED] Complete Physics Platformer Kit

Discussion in 'Assets and Asset Store' started by Greg-Sergeant, Oct 2, 2013.

  1. imma01100

    imma01100

    Joined:
    Apr 9, 2014
    Posts:
    7
    Hello Friends i have some problem need some help my problem is i have tileset level each tile have own collider and when i move player, player get stuck on tiles corner sorry for bad english
     
  2. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    That's because the box collider of the player is snagging on those microscopic edges of the box colliders of the tiles. Either drop the box colliders on the tiles and use a single large box collider to create the collision. Or update the player box collider to a capsule collider (or sphere). I ran in to this same issue while doing a sidescroller running game using a tile editor extension.
     
    imma01100 likes this.
  3. imma01100

    imma01100

    Joined:
    Apr 9, 2014
    Posts:
    7
    Worked Great Thank you
     
  4. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
  5. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Has an effort even been made to integrate it? I'm betting that energy bar toolkit just uses a float or integer to display the bar (based on a maximum value to decide how much of the bar should be filled) so it should just be a matter of pointing that kit to the currentHealth int of the Health script.
     
  6. nonameu

    nonameu

    Joined:
    Apr 8, 2014
    Posts:
    18
    is there a way to stick a pickup lets say to the hands of the player and not just floating above the head?
     
  7. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    There is a way to do anything, but it does involve learning programming.
     
  8. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    yes, lots of effort, im still learning C# , the way i'm learning is from kits like this one, forums and youtube.


    sorry i asked :(
     
  9. imma01100

    imma01100

    Joined:
    Apr 9, 2014
    Posts:
    7
    can anyone give me little idea how i make camera border e.g box collider around my sidescroller level prevent camera going out of that box collider
     
  10. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    It depends on the question, if you first try to come up with a solution yourself and when it doesn't work out ask the question here and include your code, I think you'll find people are willing to help you. :D

    Part of learning is discovering things for yourself; I guarantee you'll always learn something new.
     
  11. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Exactly this. You didn't mention anything like "I'm having trouble getting it to use this float, or that variable". You basically just asked for someone to do it for you.
     
  12. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Ok, so if your idea of learning is asking people on forums to integrate assets together for you, you're doing it wrong.
    Here is how you really learn stuff: http://lmgtfy.com/?q=how+to+health+bar+unity&l=1

    I personally would suggest you to start with something smaller though, like following the projects in the Unity Learn section: http://unity3d.com/learn/tutorials/modules

    What you're asking to be done is very simple, and if you know the basics of programming and read the documentation on the assets you could figure out for yourself, which tells me that you don't know anything about programming and just wants people to do it for you.
     
    Nateply likes this.
  13. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    thanks anyway guys. just wanted some simple help on a hobby.
    danielsnd, your links were helpful.
    (when you work at a warehouse 6 days 12 hour shifts its hard to learn coding the "right way".
     
  14. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    'A' for effort on laying that guilt trip. :cool:

    Try learning coding while working full time and being a father to 2 children. It's not easy but if you're serious about it, it's entirely possible in the limited time you have.
     
  15. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    If you're looking for an effortless hobby you should probably stay away from game development D: It definetly requires effort and time.
     
  16. nonameu

    nonameu

    Joined:
    Apr 8, 2014
    Posts:
    18
    Allright here's what hapening.

    when I press the grab key, the object just fly around the players hand. It should stick to "PlaceToCarry" object. Here's what I have.
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PickupThrowShell : MonoBehaviour {
    5.    
    6.     [HideInInspector]
    7.     public GameObject heldObj;
    8.     public GameObject PlaceToCarry;
    9.  
    10.     // Use this for initialization
    11.     void Start () {
    12.        
    13.  
    14.     }
    15.        
    16.     // Update is called once per frame
    17.     void Update () {
    18.    
    19.         if(Input.GetButton("Grab") && heldObj){
    20.             if(heldObj.tag == "GreenShell"){
    21.                 ThrowShell();
    22.             }
    23.         }
    24.    
    25.     }
    26.    
    27.  
    28.     void OnTriggerStay (Collider other){
    29.    
    30.         if(Input.GetButton("Grab")){
    31.             if (other.tag == "GreenShell" && heldObj == null){
    32.                 PickupShell(other);
    33.  
    34.             }
    35.         }
    36.     }
    37.    
    38.     private void PickupShell(Collider other)
    39.     {      
    40.        
    41.             heldObj = other.gameObject;
    42.             heldObj.transform.position = PlaceToCarry.transform.position;
    43.             heldObj.transform.rotation = PlaceToCarry.transform.rotation;
    44.             heldObj.transform.parent = PlaceToCarry.transform;
    45.             heldObj.collider.enabled = false;
    46.             heldObj.rigidbody.useGravity = false;
    47.  
    48.  
    49.        
    50.    
    51.     }
    52.     void ThrowShell(){
    53.         //do something
    54.        
    55.     }
    56.    
    57.    
    58.    
    59. }
    60.  
    thanks for the help
     
  17. lukasdragon

    lukasdragon

    Joined:
    Oct 23, 2014
    Posts:
    7
    Hey! I was wondering if anybody has been able to successfully pause the game whilst in water.... currently when I unpause and set the timescale back to 1 the player shoots upwards. Its almost as if the momentum is being built up whilst the game is paused...
     
  18. Baskyn

    Baskyn

    Joined:
    Feb 17, 2013
    Posts:
    67
    I was wondering if the timescale is being messed with in this package somewhere? I can't get "YieldWaitforseconds" to work in javascript and that's the only thing I've found that may be the problem.
     
  19. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    any idea when unity 5 version comes out?
     
  20. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Yeah, if you set Time.timeScale to 0 while a force is being applied, the force continues to build. So when it is unpaused, they fire waaaay up (or whatever direction it was pushing them). The only solution for that would be to flip a bool to true (paused for example) and contain any rigidbody.AddForce statements to only work if paused = false, for example:
    Code (CSharp):
    1. if (!paused)
    2. {
    3.    GetComponent<Rigidbody>().AddForce(transform.up * 10f, ForceMode.Force);
    4. }
    Nope, there is no code anywhere in the package that plays with timeScale. You are running the yield statement in a Coroutine I hope, right?

    Just change the mesh collider on the frame object (to be or not be convex, I can't recall) and update the skybox (Unity 5 itself has the option to patch the alpha blemishes that show in it) and it is good to go. Well with the exception of the pushables not working right with the new physics engine... :confused:
     
  21. nonameu

    nonameu

    Joined:
    Apr 8, 2014
    Posts:
    18
    Hello people,
    I've added a kick animation to the PlayerMelee script from DanielSnd.
    Below the modified code.
    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5.  
    6.  
    7.  
    8. public class PlayerMelee : MonoBehaviour {
    9.  
    10.     //We'll use those 3 to communicate with the rest of the kit.
    11.  
    12.     private PlayerMove playerMove;
    13.  
    14.     //private CharacterMotor characterMotor;
    15.  
    16.  
    17.     private DealDamage DoDamage;
    18.  
    19.     //This will be used to cycle through 2 different punch animations
    20.  
    21.  
    22.     private bool punchLeft;
    23.     private bool punchRight;
    24.     private bool kicking;
    25.  
    26.     //This will be used to check if we should ge giving damage.
    27.  
    28.     private bool Punching;
    29.  
    30.     private List<GameObject> BeingPunched = new List<GameObject>();
    31.  
    32.  
    33.     //These are our public vars, PunchHitBox should be like the GrabBox,
    34.  
    35.  
    36.     //and should encompass the area you want your punch to cover
    37.  
    38.  
    39.     public BoxCollider PunchHitBox;
    40.  
    41.  
    42.     public int PunchDamage = 1;
    43.  
    44.  
    45.     public float PushHeight = 4;
    46.  
    47.  
    48.     public float PushForce =10;
    49.  
    50.     // Use this for initialization
    51.  
    52.  
    53.     void Start () {
    54.      
    55.      
    56.         //We're supposed to be on the same gameobject as the PlayerMove,
    57.  
    58.         //CharacterMotor etc, so lets get them as reference!
    59.  
    60.         playerMove = GetComponent<PlayerMove>();
    61.  
    62.         //characterMotor = GetComponent<CharacterMotor>();
    63.  
    64.         DoDamage = GetComponent<DealDamage>();
    65.         //Did you even make a PunchBox? Or you were lazy and didn't make one?
    66.      
    67.      
    68.         if(!PunchHitBox)
    69.          
    70.          
    71.         {
    72.          
    73.          
    74.             GameObject GameObjectPunchHitBox = new GameObject();
    75.  
    76.             PunchHitBox = GameObjectPunchHitBox.AddComponent<BoxCollider>();
    77.          
    78.             GameObjectPunchHitBox.GetComponent<Collider>().isTrigger = true;
    79.          
    80.             GameObjectPunchHitBox.transform.parent = transform;
    81.  
    82.             //Let's place it a little but farther away from us.
    83.             GameObjectPunchHitBox.transform.localPosition = new Vector3(0f, 0f, 1f);
    84.             //It should Ignore Raycast so let's put it on layer 2.
    85.  
    86.             GameObjectPunchHitBox.layer = 2;
    87.          
    88.          
    89.             Debug.LogWarning("You were too lazy to make a PunchHitBox so I made one for you, happy?", GameObjectPunchHitBox);
    90.  
    91.         }
    92.      
    93.         //Also lets turn off our PunchHitBox, we'll only turn that on while punching
    94.      
    95.      
    96.         //so the Grabbing script doesn't get confused with it.
    97.      
    98.      
    99.         PunchHitBox.enabled=false;
    100.      
    101.      
    102.     }
    103.  
    104.     // Update is called once per frame
    105.  
    106.     void Update () {
    107.  
    108.      
    109.         if (Input.GetKeyDown(KeyCode.T)) {
    110.          
    111.          
    112.             //First off, let's check if we're not already punching,
    113.          
    114.          
    115.             //see if the punch animations are playing on Layer 1 (The one with the arms).
    116.          
    117.          
    118.             if(!CheckIfPlaying("RightPunch",2)&&!CheckIfPlaying("LeftPunch",2)&&!CheckIfPlaying("kick",2)) {
    119.              
    120.              
    121.                 //If I got here no punch animations are playing so we can punch now :D
    122.              
    123.              
    124.                 if(punchLeft && !punchRight) {
    125.                  
    126.                     playerMove.animator.Play("LeftPunch",2);
    127.                     punchLeft=false;
    128.                     punchRight = false;
    129.                     StartCoroutine(WaitAndPunch());
    130.  
    131.                 } else if (!punchLeft && !punchRight){
    132.  
    133.                     playerMove.animator.Play("RightPunch",2);
    134.                  
    135.                     punchRight=true;
    136.                     kicking = true;
    137.                     StartCoroutine(WaitAndPunch());
    138.                  
    139.                 } else if (kicking){
    140.              
    141.                     playerMove.animator.Play("kick",2);
    142.                     punchRight = false;
    143.                     punchLeft = true;
    144.                     kicking = false;
    145.                     StartCoroutine(WaitAndPunch());
    146.                 }
    147.          
    148.             }
    149.          
    150.          
    151.         }
    152.      
    153.      
    154.     }
    155.  
    156.  
    157.  
    158.  
    159.  
    160.     IEnumerator WaitAndPunch()
    161.      
    162.      
    163.     {
    164.      
    165.      
    166.         //Wait for 0.12f time and then punch them in their stupid faces!
    167.      
    168.      
    169.         yield return StartCoroutine(Wait(0.12f));
    170.      
    171.      
    172.         PunchThem();
    173.      
    174.      
    175.     }
    176.  
    177.  
    178.  
    179.  
    180.  
    181.     IEnumerator WaitAndStopPunch() {
    182.      
    183.      
    184.         //Wait for 0.1f time before stopping the punch
    185.      
    186.      
    187.         yield return StartCoroutine(Wait(0.1f));
    188.  
    189.  
    190.         StopPunch();
    191.      
    192.      
    193.     }
    194.  
    195.  
    196.  
    197.  
    198.  
    199.     //Coroutine for cool waiting stuff
    200.  
    201.  
    202.     IEnumerator Wait(float duration)
    203.      
    204.      
    205.     {
    206.      
    207.      
    208.         for (float timer = 0; timer < duration; timer += Time.deltaTime)
    209.          
    210.          
    211.             yield return 0;
    212.      
    213.      
    214.     }
    215.  
    216.  
    217.  
    218.  
    219.  
    220.     void PunchThem() {
    221.  
    222.  
    223.         //Enable our cool Punching Hitbox to check for enemies in there.
    224.      
    225.      
    226.         PunchHitBox.enabled=true;
    227.      
    228.      
    229.         //Turn our Punchin bool to true so our TriggerStay will check for people being punched.
    230.      
    231.      
    232.         Punching=true;
    233.      
    234.      
    235.         //Start the coroutine that will wait for a moment and stop the punching stuff turning bools back to false.
    236.      
    237.      
    238.         StartCoroutine(WaitAndStopPunch());
    239.      
    240.      
    241.     }
    242.  
    243.  
    244.  
    245.  
    246.  
    247.     void StopPunch() {
    248.      
    249.  
    250.         //Turn stuff back to false so it'll stop checking for people on hitbox
    251.      
    252.      
    253.         PunchHitBox.enabled=false;
    254.      
    255.      
    256.         Punching=false;
    257.      
    258.      
    259.         //Clear the List of people that got punched on this punch.
    260.      
    261.      
    262.         BeingPunched.Clear();
    263.      
    264.      
    265.     }
    266.  
    267.  
    268.  
    269.  
    270.  
    271.     //This function runs for each collider on our trigger zone, on each frame they are on our trigger zone.
    272.  
    273.  
    274.     void OnTriggerStay(Collider other) {
    275.      
    276.      
    277.         //If we're not punching, forget about it, just stop right here!
    278.      
    279.      
    280.         if(!Punching) {
    281.          
    282.          
    283.             return;
    284.          
    285.          
    286.         }
    287.      
    288.      
    289.         //If we are punching, and the tag on our trigger zone has a RigidBody and it's not tagged Player then...
    290.      
    291.      
    292.         if (other.attachedRigidbody&&other.gameObject.tag!="Player") {
    293.          
    294.          
    295.             //If this guy on our trigger zone is not on our List of people already punched with this punch
    296.          
    297.          
    298.             if(!BeingPunched.Contains(other.gameObject)) {
    299.              
    300.              
    301.                 //Call the DealDamage script telling it to punch the hell out of this guy
    302.              
    303.              
    304.                 DoDamage.Attack(other.gameObject,PunchDamage,PushHeight,PushForce);
    305.              
    306.              
    307.                 //Add him to the list, so we won't hit him again with the same punch.
    308.              
    309.              
    310.                 BeingPunched.Add(other.gameObject);
    311.              
    312.              
    313.             }
    314.          
    315.          
    316.         }
    317.      
    318.      
    319.     }
    320.  
    321.  
    322.  
    323.  
    324.  
    325.     //This will return a TRUE/FALSE on the animation we want to check if is playing.
    326.  
    327.  
    328.     bool CheckIfPlaying(string Anim,int Layer) {
    329.      
    330.      
    331.         //Grabs the AnimatorStateInfo out of our PlayerMove animator for the desired Layer.
    332.      
    333.      
    334.         AnimatorStateInfo AnimInfo = playerMove.animator.GetCurrentAnimatorStateInfo(Layer);
    335.      
    336.      
    337.         //Returns the bool we want, by checking if the string ANIM given is playing.
    338.      
    339.      
    340.         return AnimInfo.IsName(Anim);
    341.      
    342.      
    343.     }
    344.  
    345.  
    346. }
    347.  
    348.  



    just add an animation named "kick", to where the punch animations are.
    Ps: you may have to change the layer of your animations. ex. ...("LeftPunch",2 or 1 or 3...)...
     
    Last edited: Apr 1, 2015
  22. Baskyn

    Baskyn

    Joined:
    Feb 17, 2013
    Posts:
    67
    I figured it out. I was running an invoke in the same coroutine and they were conflicting, and wouldn't work. I ended up scrapping the invokes and only using coroutines.
     
  23. Alima-Studios

    Alima-Studios

    Joined:
    Nov 12, 2014
    Posts:
    78
    Hi

    Is there any attemp to add clamp to the ground function to this kit ?

    thanks !

     
    nonameu likes this.
  24. sirio21

    sirio21

    Joined:
    Mar 11, 2013
    Posts:
    114
    Hi, i dont see as feature ladder,rope and mario style block, any plan to add it? Thanks
     
  25. Triconcept

    Triconcept

    Joined:
    Apr 17, 2013
    Posts:
    11
    The developer is no longer developing additional features with this kit. Although he is very quick to help through email if you need advice to get something to work that is already included in this kit. A lot of the "add-ons" have been contributed freely thanks to some wonderful community members. :D There is already a ladder script created by DanielSnd around page 7 on this thread I believe. He even goes as far as making a video tutorial on how to use the scripts. Also someone else gave a "video example" of a rope and a character swinging on it a few pages back. As for Mario like boxes, do the following:

    1. Select your "box" and create a new tag for it.
    2. Create a new plane and make the plane as small as your character's head. Then place it right on top of your character's head slightly above the character's "box collider". Disable it's "MeshRenderer" script in the inspector. So it won't be seen in the game.
    3. Attach the "hazard" script to it, scroll near the bottom of the script and put your box's tag as the only effected tag.
    4. Drag it and attach it to your character model in your Hierarchy Window so it moves with your character. For a much better effect, attach it to your character's "head bone."
    5. Look at your Hierarchy Window and click on your box.
    6. Your box will need to have the health script attached to it, and whatever you want to pop out from the box place that object within the "spawn on dead" object spot on the box's health script.
    7. If you want your box to not disappear but still pop out an item. You will need to change the value of objects spawn on death to 2 not 1 and place both prefabs in the empty slots. Make sure your "empty box's" prefab has the health script disabled or removed so it won't disappear if it's hit, and change it's texture to maybe a dark or grey color to indicate it's empty.

    Since the box has a health script it's possible for it to disappear if certain objects touch it too much or collide with it a certain way. If you only wanted the player to be able to hit it and get the item to pop out then you will need to make two new layers and change their physics detection properties.
    Make a new layer for the box, and another for the plane on top of your character's head. Then go to the "physics" located within the "project settings" in the "Edit" tab of Unity. The Edit tab is located at the top of the Unity program. Once your there you'll see a bunch of rows of boxes with check marks. Find the two new layer names and uncheck all the boxes on their rows except for when they share a single box. Leave that one checked. It will tell the engine to allow for physics detection between the two layers.

    Also it helps the community out if you search the whole thread before asking questions to make sure the answer hasn't already been provided. I'm not mad, just thought I'd share that advice because not everyone on this website is "question friendly." On a side note for your future game creating endeavors remember this. Sometimes we have ways of accomplishing the things we want if we look at what we already have from a different perspective. One man's trash could very well indeed be another man's treasure. ;)
     
    Last edited: Apr 3, 2015
  26. Triconcept

    Triconcept

    Joined:
    Apr 17, 2013
    Posts:
    11
    This would involve some reprogramming of the kit's "player move" script. I'm not that great at programming but the easiest way I see this being accomplished while keeping a (mario like) jump would be in some way changing the character's gravity values. However that will effect the jump height , so you'd have to change the gravity value before the character leaves the ground then revert it back once he lands. So you'll stick to the ground surface until you jump. All can be coded and fit well within the "player move" script.
     
  27. Baskyn

    Baskyn

    Joined:
    Feb 17, 2013
    Posts:
    67
    For those who have messed around the the movement variables of the character, is there a way to have a quick left/right movement in the air? Like super mario world? Right now, the character slowly starts moving the other way.
     
  28. Riff-Rex

    Riff-Rex

    Joined:
    Mar 14, 2014
    Posts:
    19
    If I understand you correctly, try increasing the "Air Rotate Speed" variable in Player Move.
     
  29. Baskyn

    Baskyn

    Joined:
    Feb 17, 2013
    Posts:
    67
    I think that just changes the speed of your rotation in the air. It doesn't actually change the speed you move in the air. I'm trying to make it so I have more control in the air.
     
  30. Riff-Rex

    Riff-Rex

    Joined:
    Mar 14, 2014
    Posts:
    19
    Have you tried messing with Air Accel/Air Decel?
     
  31. Baskyn

    Baskyn

    Joined:
    Feb 17, 2013
    Posts:
    67
    Yes, if I increase Air accel, he goes flying really fast in the air. I haven't messed with air decel as much, but it didn't give more control from what I could tell.
     
  32. hariz_hasnan

    hariz_hasnan

    Joined:
    May 6, 2014
    Posts:
    2
    Where is Script for PlayerMelee?
     
  33. PedroNeves

    PedroNeves

    Joined:
    Feb 23, 2014
    Posts:
    10
    how do we edit the gui?
     
  34. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    In the GUIManager.cs script.
     
  35. Battin

    Battin

    Joined:
    Apr 8, 2015
    Posts:
    11
    For what I can see, it looks amazing.
    To be honest, I haven't bought it yet, but I'm willing too.

    I'm just curious though, is there any news on updates? Is there a new update coming?
    I'm missing some animations, physics that I would like to see added to this package (ledge climb, ledge hanging, swinging, swimming, perhaps "dual pistol" shooting? (Ok, that dual pistol thing is a joke :p )

    Would love to see more. If this is getting updates with new items, animations ect. ect. I WILL BUY IT. Looks amazing.
     
    Last edited: Apr 8, 2015
  36. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    I don't think this will be getting any more updates. And apart from the fix for Unity 5, I don't think that is a bad thing.
     
  37. Battin

    Battin

    Joined:
    Apr 8, 2015
    Posts:
    11
    Oh, that's too bad :( Would love to see more to this package.
    Wouldn't it be a shame to let this asset "die"? It has so much potential.

    PS: May I ask why there aren't more updates coming? (Don't get me wrong, but I think it's a shame this project/asset isn't getting updated with new things)
     
  38. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Because Greg hasn't been seen around here in months. My question though is what would need to be added to it? If every developer catered their "project templates" to what everyone wanted and added everything they requested, they would never get done. You're better off viewing the kit as a starter kit and building upon it yourself.

    The only thing I could foresee is Unity 5 compatibility out of the box. But with the changes made with PhysX 3.3 in Unity 5, I'm not sure the pushable mechanics of the 4.x era will work without heavy retooling.
     
  39. Battin

    Battin

    Joined:
    Apr 8, 2015
    Posts:
    11
    Wait, I'm confused.
    I came across this website some time ago that was about "expanding" on this kit.
    http://www.besusproductions.com/expanding-on-the-complete-physics-platformer-kit/

    And to answer your question, I would love to see the things added there :)
    I thought the owner of this pack was expanding the assets, but I guess i was wrong (i see now that it's your website and your work that has been added :))
     
  40. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Anyone can buy this asset and create or add whatever they want to it. You definitely can see more to this package, you just have to build it.
    I don't think this asset will die as long as it is still for sale, it does what it promises and does it well. It is a great starting point to create a 3d platformer. There is no need for things to be added (apart from the unity 5 update.)

    You can add whatever you want to it, all you need to do is learn how to code.
     
  41. Battin

    Battin

    Joined:
    Apr 8, 2015
    Posts:
    11
    In that case, I really need to learn how to code. I have no experience with coding, other then changing existing codes (with lots of effort :)) to do something else. I'm a graphics designer, so the coding is done by somebody else :)

    Thank you for the help.
     
  42. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    When I first started I was just a 3D Artist. If you really want to, you can learn :) changing existing codes is a great way to start, and by reading and understanding this kit you can learn a whole lot.
     
  43. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    Hey Daniel, what's up?
    Besus, You had reason! I just reverted it and recovered draw calls...
    The only problem with updating my project to Unity 5 now is about my player having small issues...: Trouble going over small obstacles (sometimes, only with an object made with probuilder sticking out only 0.1 from the floor) and in rare cases, stay up over the head of the enemy (not "fly").
    Anyway thanks for commenting about the jump corner...
     
    Last edited: Apr 10, 2015
  44. Battin

    Battin

    Joined:
    Apr 8, 2015
    Posts:
    11
    Well, I've read the code of the kit and I'm able to change things to my needs. It takes time, but I'll get there.
     
    Last edited: Apr 11, 2015
    DanielSnd likes this.
  45. Spram

    Spram

    Joined:
    Apr 11, 2015
    Posts:
    4
    Hello!

    I know this is terribly late but I added DanielSnd's projectile shooter script (it's somewhere in this page: http://forum.unity3d.com/threads/released-complete-physics-platformer-kit.203279/page-7) to my character and it works nicely and all but..

    I want my projectile to be affected by gravity so I replaced this on the projectile's script:

    rigidbody.MovePosition(rigidbody.transform.position+(transform.forward*ProjSpeed*Time.deltaTime));

    with this:

    rigidbody.MovePosition(rigidbody.transform.position-(transform.up*ProjGrav*Time.deltaTime)+(transform.forward*ProjSpeed*Time.deltaTime));

    (ProjGrav is a public float variable that I made) This makes the projectile (a tomato) go down but at a steady rate. It doesn't accelerate or look realistic at all. Also, I would like to make the projectile start going up and then arching down.

    I assume I have to make something that counts the amount of time the projectile has been on the scene and add velocity (gravity) to it but I have no idea how to do it. Sorry if I'm asking for too much but can anyone help me out?

    EDIT: Also the projectile doesn't get destroyed when it hits the enemy or anything else! Sorry for all the text!

    EDIT2: I added DanielSnd's constant rotate script to the tomato and somehow set it up to rotate in such a way that looks like it's being affected by gravity... Might come back and bite me in the butt but it's a solution.

    EDITYETAGAIN: Added a video:


    Notice how the tomato's stalk is facing forward.
     
    Last edited: Apr 11, 2015
  46. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Cool solution xD I like the way this is looking :)
     
  47. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    It's time for maths! One solution is to use a parabolic function for this, you know ax^2+bx+c… :D
     
    Fowi likes this.
  48. MrBalin

    MrBalin

    Joined:
    Sep 6, 2014
    Posts:
    8
    I am curious to see if I can add a Lerp to the moving platforms to help avoid the player's continued velocity as soon as the platform comes to a stop or starts to move. Would anyone know how this can be done?
     
  49. Battin

    Battin

    Joined:
    Apr 8, 2015
    Posts:
    11
    Okay, another question. I have bought "Platform Character Animations Pack" https://www.assetstore.unity3d.com/en/#!/content/21687. Been trying to change the player, animations etc, but the game it only showing the T-Pose. No animations or anything else.

    How to change the character from the kit to this player with animations?

    Edit: Seems to been working. Don't know what I did, but I did something :p
    The only problem is now that I get an error after the Idle Animations is done playing.

    The "game" windows paused and needs to be restarted.
     
    Last edited: Apr 20, 2015
  50. PedroNeves

    PedroNeves

    Joined:
    Feb 23, 2014
    Posts:
    10
    how do we edit the char?