Search Unity

On Rails Shooter Game Template

Discussion in 'Assets and Asset Store' started by puppeteer, Oct 14, 2016.

  1. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Here's how you can change the recoil and spread of your weapon:

     
  2. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 0.3 is live on the store, go get it!

    https://www.assetstore.unity3d.com/#!/content/73628



    0.3 (02.11.2016)
    • You can set multiple paths from each waypoint, so the player can choose where to go next.
    • Weapons now have a Recoil attribute, which makes them kickback when shooting.
    • Hittable objects ( things that can be hit, destroyed, and enemies ) can flash when hit.
    • You can set the player to keep moving even when enemies appear. This allows you to create "driveby" encounters.
    • Player auto aligns to the starting waypoint inside the editor, so you can see where it will start playing.
    • You can create a slow motion effect.
    • Enemy Animator can be placed anywhere within the enemy prefab.
    • Particle effects now play a random seed each time they trigger.
    • You can set a de-spawn time for enemies, making them hide again after appearing.
    • You can choose to attach hit effects to the parent object that was hit.
     
  3. ThermodynamicsMakesMeHot

    ThermodynamicsMakesMeHot

    Joined:
    Feb 14, 2015
    Posts:
    224
    This error happens when you choose left and kill the last worm.

    Debugged it out to this particular object: EnemyWorm wp13to20 (4)

    Here was the error:
    Code (csharp):
    1.  
    2. MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
    3. Your script should either check if it is null or you should not destroy the object.
    4. OnRailsShooter.ORSGameController+<DeactivateObject>c__Iterator5.MoveNext () (at Assets/ORSAssets/CS_Assets/CS_Scripts/ORSGameController.cs:500)
    5. UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
    6.  
    I fixed it by wrapping an if statement around the deactivate command to check that it's still active.

    Script: ORSGameController
    Line: 500

    Code (csharp):
    1.  
    2.    if (deactivatedObject != null)
    3.    {
    4.           deactivatedObject.SetActive(false);
    5.    }
    6.  
     
    puppeteer likes this.
  4. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Thanks for the catch, I just tried it out and it happens on my build too. Will be fixed next update.
     
  5. J0linar

    J0linar

    Joined:
    Dec 12, 2013
    Posts:
    83
    @puppeteer
    Hey there i just recently purchased ORS
    and i would like to Know how to add actual 3D Models as Weapons?! Maybe you could make a Tutorial, about that.
    Another thing is am working in a VR Project and would like to Know if ORS will receive a VR update?

    Thanks for taking the time and thank you for creating ORS! It is really a great Starterting Base for OpenRail Shooters.
     
    puppeteer likes this.
  6. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I recently made a change in the code to use an empty Weapon object as the source of the shot from the player, this can potentially be used to place a model of the current weapon you're carrying and be aiming at where you want to shoot. I'll look into it further.

    About VR, Keep following this thread I'm posting something new this weekend.
     
  7. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Any updates on the Gear VR controls being implemented?
     
    puppeteer likes this.
  8. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I made a few tests on GearVR this weekend to get the VR update ready as soon as possible.



    Looking around while moving on the path works correctly, shooting should also be fine. Once we get the custom UI for the VR camera running I'll just optimize the level for the system or even cut it down to a scene especially set for VR.
     
  9. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    Hi @puppeteer
    I am planing to buy this for my future prj. Can you add in mobile controls as well. I am targeting play/app store release.
    Have already bought you trivia and mvr tower defense assets. I like the support you provide. So would prefer to buy this one too if mobile compatible.

    Targeting to buy in a month or 2. Once my game based on MVR is out.
     
    puppeteer likes this.
  10. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    The game does work on mobile, shooting, picking up items, UI, etc:



    Though I would have preferred if it had its own mobile demo for performance purposes, but some scheduling mistakes got me off track with this project. I will mend this starting with smaller, more frequent update with useful features I am certain I'll be able to make.
     
    pushingpandas likes this.
  11. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    Hi @puppeteer wanted to check can we change the view from FPS to third person
    I know there are other third person packages but I like your awesome support
    so just checking
     
    puppeteer likes this.
  12. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Though I didn't try it, you can drag the camera away from the center point of the player and place a "player" object in view.

    But I was thinking of a different way to use the package for games like StarFox:



    Basically, the on-rails path moves automatically while the player moves within a limited 2D area and can shoot into their path.
     
  13. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    @puppeteer just checking can you creat mecanim animation controller with animations for shooting etc once I buy it so I can make a TPS on rails :)
     
    Last edited: Sep 23, 2017
    puppeteer likes this.
  14. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    are any more features planned? I would love to see ORS getting more love
     
    puppeteer likes this.
  15. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I'm going to reignite this one, will have to make a cleanup pass first because of the new submission guidelines and then push smaller updates to keep it going.
     
    pushingpandas likes this.
  16. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Does this work with the new gear vr controller? Would like an APK to install on phone to see if this works as expected in gear before purchase. Would really like to support your work here but im an artist so I need something I can just plug in new art assets to make it my own.
     
  17. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    This was something I tried before to make it work in gear vr, but unfortunately it didn't work as expected especially the UI elements.
     
  18. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Here's a bit from the upcoming update, health bar and name tags (Turn on closed captions):

     
    karmik and pushingpandas like this.
  19. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 0.4 has been submitted to the store:

    0.40 (19.11.2017)

    - You can set a custom hurt effect for each enemy projectile, which appears on-screen.
    - You can add a health bar and name label above each enemy. Health bars are world UI.
    - Optimized scenes for mobile play, tested on Samsung Galaxy S6 and LG V400.
    - Bug fix: If an enemy who has slowmotion effect dies, the slowmotion is cancelled.
    - Bug fix: Recoil position is no longer affected by actual screen size.
     
  20. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    really nice thank you!
     
    puppeteer likes this.
  21. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    Hi @puppeteer I am planning to have a arena level in my next mobile game where the enemies keep reappearing/respawning. So I want to check if the enemies in This asset are pooled. As pooling and deactivating/reactivating enemies and bullets gives better performance
     
    puppeteer likes this.
  22. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    The plan with the next update is to have the enemies despawn on death ( and show the death effect then ) instead of being destroyed (as they are now in version 0.4), which allows them to be respawned when the player revisits a waypoint. This will allow reusing these assets indefinitely.

    The projectiles and hit effect will still be instantiated and destroyed though, so they are not in any type of pool.

    How do you plan to make your arena game? Is it a looping path with enemies that keep respawning at each waypoint?
     
  23. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    Yes a looping game. Sounds great
     
    puppeteer likes this.
  24. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Okay, so the looping functionality will be covered, but then I assume you want to increase or change the enemies in each run-through, right? You wouldn't want to just keep going through the same waypoints respawning the same enemies that died, no?

    How would you approach that?
     
  25. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I'm working on the next update for On Rails Shooter, here's a glimpse of the destructible objects that drop items too.

     
  26. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Another thing that will be in the next update is the new end-screen, which shows some stats such as hit Accuracy, How much health you have left, and how much of the level you completed. Each of those will give the player a bonus which is added to the score you collect during gameplay for killing enemies, destroying objects, and collecting items.

    You also get a rank icon based on the score you got for that level.

    ORSStats.jpg
     
    pushingpandas likes this.
  27. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Be great if we could eventually do games like House of the Dead type series from opening game menu to end screen. So many good ideas in those games for this package.
     
    puppeteer likes this.
  28. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    One of the things I love from House of the Dead is how the bosses have weak points. I want to add something like this where you set one or more weakpoints that do extra damage.
     
  29. croesus42

    croesus42

    Joined:
    Oct 30, 2014
    Posts:
    23
    Hello. I've just purchased the asset and watch the videos on youtube channel. I am trying to replace the ebemies with zombie models. I didn't understand the video of "Adding a new enemy using Simple Military assets" because it has no sound or subtitle and it is difficult to follow (at least for me). I spawned the zombie model but without animations. And it dissapeared suddenly after death without the death animation. Can you make a step by step PDF tutorial or something like that?
     
    Nottingham1stBlood and puppeteer like this.
  30. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi,

    As mentioned in the reply to your comment on the video, you can turn on subtitles/closed captions by pressing the [CC] button at the bottom side of the video window.

    Here is the aforementioned video btw:


    If you get stuck at any point just ask me and I'll try to help.
     
    croesus42 likes this.
  31. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I've been receiving some messages regarding melee attacks in the game, which got me thinking of a way that might be a great overall solutions for all attack types in the game.

    The way I thought to do it is to have a list of AttackTypes for each enemy. These attacks can be either melee or projectile, and each will have its own animation, damage, attack speed, etc. If an enemy has more than one attack type it will alternate between them randomly, so sometimes it will attack with a projectile and sometimes it will attack with a melee, or even switch between several melee animations. The benefit of this is that you can have much more variation in your enemies and be able to make complex enemy bosses for example that attack in several different ways.

    So in short, the way I see it:
    - Each enemy has a list of attack types.
    - Each attack type has attributes: animation, damage, range, projectile/melee, speed, etc.
    - You can have more than one attack per enemy, and choose whether to randomize them or not.

    Would love to read your feedback about this guys!
     
  32. tng2903

    tng2903

    Joined:
    Apr 8, 2013
    Posts:
    41
    hello, just bought your asset, keep up the good work my friend, hoping to get updates for at least 1 more year (too greedy I know :D, but just hoping)
     
    puppeteer likes this.
  33. tng2903

    tng2903

    Joined:
    Apr 8, 2013
    Posts:
    41
    this would be very cool indeed, but just to be clear, will they all start from the same base class (attackbase or something)?
     
  34. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    The way I have it set now is that you have the array of attack types in the enemy component, and would be either melee or ranged based on whether you assign a projectile or not.

    Here's my new Enemy component so far:

    ORSAttackTypes.png

    Instead of assigning a Projectile object ( which contains info about speed, damage, etc ) you will be able to create the attacks like in the yellow box. For each attack you can put a custom animation name, a projectile ( or none if melee ).
     
    croesus42 likes this.
  35. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    yeah boss fights please!!!!!!
     
    puppeteer likes this.
  36. tng2903

    tng2903

    Joined:
    Apr 8, 2013
    Posts:
    41
    Look cool to me, but in your yellow box, i'm wondering if:
    - Attack Speed is Projectile speed?
    - Hurt effect is Hit/Impact effect?

    Beside, there is something about the structure, I think it's best to just set up the AttackTypes as an array or a list<>, then move those attack definition into seperate files (ScriptableObject), this way you could edit the attack without the need to browse the hierarchy each time.
     
    puppeteer likes this.
  37. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I can do it like the way we assign Projectiles now, so instead of a Projectile you would assign one or more Attack and this way you can edit them and pass them around to different enemies without trouble.

    Attack Speed is the speed of a projectile, or if using melee the speed at which the enemy moves towards the player before attacking. Not final on this idea yet.

    Hurt Effect is the effect that is created on the screen when the player gets hit by this attack.
     
  38. croesus42

    croesus42

    Joined:
    Oct 30, 2014
    Posts:
    23
    The system looks good. We can assign multiple attack types to enemies so we have unpredictable enemies :) One question, will attacks play randomly or in the given order? Or can we choose it?
     
    puppeteer likes this.
  39. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Yes, you can toggle between random or not for the attacks of an enemy. So it will either use the attacks randomly or use them in order. I can't think of a third option or order of using attacks right now, but if you have an idea, share it.
     
  40. abdullahtariq154

    abdullahtariq154

    Joined:
    Jun 11, 2017
    Posts:
    1
    i am using control freak 2 to make controls for mobile input . but when i use joystick to move the cross hair it doesn't show its image . can you tell me how to show the cross hair on mobile . . ?? the controls are working perfectly on computer but when i take build game and play on mobile the cross hair disappears . i have even tried to comment the line no 165 in ors game controller script which says

    "
    if ( Application.isMobilePlatform )
    {
    isMobile = true;

    // If a crosshair is assigned, hide it
    if (crosshair) crosshair.GetComponent<Image>().enabled = false;


    //crosshair = null; // If is is uncommented it will cause aiming not to run at all on mobile
    }
    "
    but this also doesn't work kindly help me
     
    puppeteer likes this.
  41. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    There's another line of code that hides the crosshair after the shoot animation ends:

    ORSMobileNotShooting.png
    Try it and tell me if it worked out for you.
     
  42. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Next update for On Rails Shooter has been submitted to the store, should be live within a few days. Here's what you'll find in it:



    Update 0.6 (20.12.2017):

    - Examples of destructible environment objects such as barrels and buildings.
    - Destroyable objects/enemies and pickup items give bonus score.
    - You can set loot drop from destroyable objects, including items list and drop chance.
    - End-of-game statistics show bonus score for accuracy, health, and completion, and a rating icon based on the total score.
    - You can set one or more actions that happen when the player reaches a waypoint. This can be chosen from any object and public function in the scene.
    - You can have a list of attack types that the enemy can use in sequence or randomly. Each attack has its own animation/effect/damage/range.
    - You can have a melee enemy attack type which gets closer to the player and then attacks them directly without throwing a projectile.
    - Randomized corpse rotation for a nicer variation when enemies die.
     
    Virtuadreamer and croesus42 like this.
  43. croesus42

    croesus42

    Joined:
    Oct 30, 2014
    Posts:
    23
    Hello @puppeteer, I managed to walk the enemy to player and when reach it, it plays the melee attack animation. But after the animation the health don't reduce.
     
    puppeteer likes this.
  44. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi, it looks like one of the versions has the damage registered in the positive instead of negative, so it adds health instead of reducing it.

    If you can open your ORSEnemy script and check if the '-' sign is like the screenshot below:
    ORSNegativeDamage.png
     
    croesus42 likes this.
  45. croesus42

    croesus42

    Joined:
    Oct 30, 2014
    Posts:
    23
    Ok, I added the "-" in the correct place but still no health reduce. I looked into your manta melee attack and made the setups for my models.
     

    Attached Files:

  46. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Testing on my side it seems to work fine ( damage value reduces from enemy health ). Check your private messages I'm sending you a care package.
     
  47. JustinKirkwood

    JustinKirkwood

    Joined:
    Mar 8, 2013
    Posts:
    4
    Would love to see that boss critical hit system mentioned in previous posts!
     
  48. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I would like to see it in action too :D
     
    Nottingham1stBlood likes this.
  49. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Finally got the multiple-hit-areas feature to work the way I want, you will now be able to set multiple hit areas, each with its own collider, damage modifier, and damage effect.
    Here's how it works:

    ORSDamageAreas.png

    In the screenshot above we set a box collider that has a damage multiplier of 0, so all damage is multiplied by 0 meaning that you cannot harm the enemy by hitting this area. We also put a hit effect of stone.
    We also set a sphere collider at a different position and gave it a 2 damage modifier so it will damage the enemy for double, and we set a hit-meat effect to show that we are killing it.

    I made it so that you're not forced to assign damage areas if you don't want to. You can just leave this info empty and it will fill automatically when the enemy is enabled in the game, by auto-assigning all available colliders damage areas with 1 damage modifier and no special effect.

    What do you guys think?
     
  50. croesus42

    croesus42

    Joined:
    Oct 30, 2014
    Posts:
    23
    @puppeteer Wow, it looks cool and it can work on every enemy type. Good work man. Now I can make a headshot for my zombies :) And you can add "Bonus" section for each hit zone. So we can give more points for headshots ;)
     
    Last edited: Jan 22, 2018
    Nottingham1stBlood and puppeteer like this.