Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Mines Evader Free Template

Discussion in 'Assets and Asset Store' started by EbalStudios, May 15, 2018.

  1. EbalStudios

    EbalStudios

    Joined:
    Nov 20, 2016
    Posts:
    105

    These are the tutorials:


    Mines Evader: https://assetstore.unity.com/packages/templates/packs/mines-evader-118723

    This free package represents only one component of our complete shoot 'em up creator package
    Shmup Baby: https://assetstore.unity.com/packages/templates/systems/shmup-baby-128937

    Mines Evader is a Unity engine template, in which the goal of the player is to detonate as many mines as possible; by coming close to them then escaping away before they explode.

    Its behaviors are physics based, uses a minimum number of scripts. And is compatible with both mobile and desktop applications.

    Features
    • Physics based proximity mines system.
    • Detailed mines controls
    • Mobile and desktop controls support.
    • Uses Unity event system.
    • Camera tracks player and auto clamps game region.
    • Bullet burst based on particle system.
    • Warning flash color.
    • Easily customizable background, player and enemies.
    • Royalty free audio to use in your commercial game.
    • 4 Ready to use and modify demo scenes.
    • Artwork included.
    • Animated effects and explosions.
    This package was initially given for free in order to test uploading packs to the asset store while we were creating Shmup Baby, we are now in the process of updating it and thinking of transforming it into a tutorial to help anyone starting out in Unity.

    While this is the support thread for this pack, we most certainly cannot support the hundreds of downloads for this pack with each developer potentially having questions on how to modify this pack especially that it's targeted for beginners.
    This thread is mainly for improving the pack and notifying us if there were any errors in it. We cannot reply to questions about building your own game as it will take us away from our work and our support to clients who have bought our packs.


    Version 2 should be improved a lot with better script comments and tutorials on how it functions. Thanks!
     

    Attached Files:

    Last edited: Dec 5, 2018
    DrOcto likes this.
  2. EbalStudios

    EbalStudios

    Joined:
    Nov 20, 2016
    Posts:
    105
    Going to add in this post, any questions that you guys ask, so that we keep it easily at the top to find easily and be a summary of the most frequently asked questions and their summary.

    FAQ
     
    DrOcto likes this.
  3. kamilbubela

    kamilbubela

    Joined:
    Nov 6, 2018
    Posts:
    11
    Hi, thanks for making this template, it's very useful! However I have a hard time understanding the physics based movement system and how to modify it. For example I want to add a function that would temporally stop player movement on one axis while maintaining current velocity. Would it be done through the Player or PlayerAnim script?
     
  4. EbalStudios

    EbalStudios

    Joined:
    Nov 20, 2016
    Posts:
    105
    This pack really needs an update, we first released it to test uploading packs to the store while we were working on https://assetstore.unity.com/packages/templates/systems/shmup-baby-128937

    If you are using an animation with the player then you should update the PlayerAnim script, if you are not using the animation then you should update the Player script.

    Basically if the PlayerAnim script is used then it overrides the player script
    In the next update I actually changed things a bit and made the animation script a separate component because I felt it would make much more sense, but I am just waiting to refine things a bit, the camera script now also has a bug and there are some small issues here and there, but it's taking some time because we are working on some other assets and I am also thinking of turning this into a tutorial where I record few video to explain how things work.

    Hope this helps, let me know if you need anything.
     
  5. kamilbubela

    kamilbubela

    Joined:
    Nov 6, 2018
    Posts:
    11
    I see! I have added this code to the Player script, I want to turn off the forward/backwards movement on trigger. I think it's pretty self explanatory but it doesn't seem to be doing anything, perhaps you would know best what exactly am I doing wrong.


    Code (CSharp):
    1.  
    2. public bool canMove = false;
    3. public virtual void StopMoving()
    4.         {
    5.             if (canMove)
    6.             {
    7.                 MyRigidbody.AddForce(transform.forward * Speed, ForceMode2D.Force);
    8.                 MyRigidbody.AddForce(-transform.forward * Speed, ForceMode2D.Force);
    9.  
    10.             }
    11.         }
    12.  
    13.         void OnTriggerEnter2D(Collider2D other)
    14.         {
    15.             if (other.tag == "StopMoving")
    16.             {
    17.                 canMove = false;
    18.                 Debug.Log("Cannot move.");
    19.             }
    20.         }
    21.  
    22.         void OnTriggerExit2D(Collider2D other)
    23.         {
    24.             if (other.tag == "StopMoving")
    25.             {
    26.                 canMove = true;
    27.                 Debug.Log("Can Move");
    28.             }
    29.         }
     
    Last edited: Dec 5, 2018
  6. EbalStudios

    EbalStudios

    Joined:
    Nov 20, 2016
    Posts:
    105
    Sorry, I probably missed something, but where are you accessing stop moving from? and I assume you are not using verical/horizontal input. Can you just try going back few steps and removing the triggers for now and try to move the player with the rigidBody
     
  7. kamilbubela

    kamilbubela

    Joined:
    Nov 6, 2018
    Posts:
    11
    I'm using the Horizontal and Vertical input, haven't changed anything in the Player script. The StopMoving void and canMove is supposed to be a boolean to restrict movement if enabled but I must be missing something.
     
  8. EbalStudios

    EbalStudios

    Joined:
    Nov 20, 2016
    Posts:
    105
    Basically I think you are never accessing StopMoving() at all, you can try to put a debug there to see if you do, you should put your "if (canMove)" inside the fixed update for the player which uses input and if you build for mobile you should put it into the mobile moving methods as well.
     
    Last edited: Dec 6, 2018
  9. EbalStudios

    EbalStudios

    Joined:
    Nov 20, 2016
    Posts:
    105
    edit: if you are using the animation version of the player, playerAnim as in the spaceship or space insect you should put these modifications inside playerAnim
     
  10. EbalStudios

    EbalStudios

    Joined:
    Nov 20, 2016
    Posts:
    105
    Code (CSharp):
    1.             #if UNITY_STANDALONE || UNITY_EDITOR
    2.  
    3.             float VerticalAxis = Input.GetAxis("Vertical");
    4.             float HorizontalAxis = Input.GetAxis("Horizontal");
    5.  
    6.             if (!stop)
    7.             {
    8.                 MyRigidbody.AddForce(VerticalAxis * transform.forward * Speed, ForceMode2D.Force);
    9.                 MyRigidbody.AddTorque(-HorizontalAxis * RotationSpeed);
    10.             }
    just used an if statement with a bool value like you did with the Rigidbody addforce and torque statements that are located in the fixed update, this should be done in player if you are using player or in playerAnim if you are using that.

    Anyways almost finished rewriting the code for Mines Evader, it should be a lot more user friendly now with better commenting and coding practices.
     
    Last edited: Dec 6, 2018
  11. kamilbubela

    kamilbubela

    Joined:
    Nov 6, 2018
    Posts:
    11

    Thanks, that worked! Looking forward to the update.
     
    EbalStudios likes this.