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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[New asset] 2D Homing missiles that use a PID controller

Discussion in 'Assets and Asset Store' started by gamedevassets-sean, Jul 12, 2014.

  1. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Asset is now live on the Unity Asset Store - http://u3d.as/8sX

    Hey all,

    I've submitted a new asset - (now released!) :) You can check out my current Web GL demo here:

    2D Homing Missiles WebGL Demo

    You can also check out a demo of the missiles in use in my current game I'm developing - a sci-fi / space 2D shooter -

     
    Last edited: Sep 15, 2015
  2. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    537
    Looks very cool.
     
  3. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Thanks!

    By the way, if anyone has any suggestions as to features to add to this asset, please let me know.

    One that I already plan to release for a 'ver 1.1' if the asset goes live is 'missile fuel'. Basically a boolean flag to enable along with a float value of fuel. While the missile is flying the fuel runs down, and after reaching 0 the missile will detonate if the flag is enabled.
     
  4. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    537
    While we wait for the review can you show us some advance on how to use the asset (like a mini video tutorial or something)
     
  5. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Sure - I'll record one this evening and put it up so you can check it out! It really is simple though - you pretty much just drop the missile into your game scene (or a bunch of them) and drag and drop target gameobject's onto each one's target property. More likely though you'll be instantiating them via code or an object pool, so that is also pretty simple - but I'll cover both.
     
  6. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Asset is now live! Go grab a copy here: http://u3d.as/8sX

    :)

    If anyone has any questions or needs help achieving something specific with the asset, feel free to post your questions here.

    @b4c5p4c3: I've recorded a tutorial to show usage of the asset and an example, but its taking a while to render/convert now. I should have it uploaded fairly soon! :)
     
  7. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    3d version?
     
  8. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    If there is a demand or need for 3D, I could definitely add that option, shouldn't be too much effort to convert the missile controller logic to take the Z axis into account :)
     
  9. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    There is a small issue with the demo scene in the current version in that the sprite layer ordering is lost- this is a bug in Unity 4.3 - where exporting an asset package loses sprite layering orders. The simple fix is to add your own layers and assign them to the missile sprite and the target platform, or to manually set differing Z positions for the missiles and space platform. Otherwise I'm submitting an update that sorts it all out with a work around for the demo scene.

    Main thing to note is that this is only an issue with the demo scene - there is nothing wrong with the actual missiles controller logic, and so if you use them in your own game/scenes everything will be fine! So just in case someone loads up the demo scene from the asset download and notices that the missiles are 'invisbile' :)

    Otherwise, here is a tutorial/work through - showing the very basic method of how to add a missile to your scene, and from there how to use the missile launcher script (or the logic to create your own):

     
  10. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Version 1.1 submitted and pending review. Here are the changes:

    • Added basic explosion particle effect for missiles by default, (or use your own like Detonator)
    • Added fuel option for missiles - optional property to enable - if enabled and set, when their fuel runs out, missiles will detonate
    • Improved demo scene GUI and added labels for missile performance sliders
    • Fixed 2D layer ordering issue in the demo scene
     
  11. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I would want 3d version
     
  12. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Ok that is two requests for 3D version - I'll see what I can do over the weekend, although I am finishing up work on another asset which is almost done : ) I should get time to look into adding 3D to this one though.
     
  13. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    537
    I just bought this and if possible i would want the 3d version too :D
     
  14. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Thanks for the support! :)

    I'll be looking into 3D this week - I've been working on finalising another asset which has now been submitted, so I'll just need to finish up some documentation for that one before I get a chance to look at extending this.

    Also not sure how I would incorporate it with this asset, as its explicitly named "2D Homing missiles"! Perhaps if I can figure out how to rename an asset, then once I've added 3D options in, then I can genericise the name of the asset. Anyway, I'll post an update here once I have some progress!
     
  15. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Hey guys, a quick update - I am nearly done implementing 3D missiles :) I just need to verify some stuff with the asset store team first with regard to renaming of assets - or I will release this one separately (as the current asset is named "2D" specifically) and for anyone who already bought a copy, I'll just grab your invoice ID from you in a PM and then send you a free copy of the 3D version.

    I'm a bit busy with another asset right now as well as my full time job so I expect this might take a week or so...

    Cheers!
     
  16. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    537
    Great News
     
  17. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    537
    Any news about the 3d version??
     
  18. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Still a work in progress - cleaning up needed, but I'm aiming to finish work on it by the end of the week. If I do so I'll post up here to let you know, at that point perhaps I can fast track it to you by just sending you a direct download link.

    Unfortunately I have a full time job too which combined general busy period I have going on at the moment means it's been on the backburner for a bit. Shouldn't be long now though - appreciate your patience!
     
  19. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    537
    Is the 3d version going to be released any time soon??
     
  20. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Hi b4c5p4c3,

    Sorry for the delay, I've been having rotation issues on this so I parked it for a week. I'll try finish this for you personally, but I don't think I'll be releasing it as an official asset store asset - it just makes things too complicated with editing and name changing the existing 2D package.

    As soon as it's done I'll get in touch to give you the 3D asset pack directly, but otherwise the 2D asset will stay as is - and just receive any updates to the 2D components :)
     
  21. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Hey guys,

    Sorry for the delay in getting the 3D version out - turns out having a pregnant wife messed with my schedule more than I expected!

    Anyway, I've decided not to release the 3D version with this asset - the 3D version is not something I want to bundle with this asset, as this one is clearly called "2D homing missiles", and changing the name, supporting documents and artwork etc to incorporate both would be a pain.

    I'll instead be creating a separate 3D version and releasing that - giving people the choice of which one they want to grab based on their game style.

    If you did purchase this (2D version) before this post's date, then please send me your Unity invoice ID via PM, and I'll send you a free copy of the 3D version after verifying your invoice ID as a thank you for supporting the 2D version! :)
     
    Last edited: Nov 12, 2014
  22. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Hmm, I still waiting for the 3d. If I get it now, will you send the 3d version?
     
  23. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    I've actually already finished the 3D Homing Missiles asset now - it's been submitted to the Unity Asset store review team and is awaiting review. I've released it on my own personal site for purchase ahead of time too, but won't link directly to it here due to this being the Unity forums :)
     
  24. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Hey guys,

    I am working on a version 1.2 update, with lots of new features and a cool new editor to customise the way missiles are launched and how they behave!

    Here are some early screenshots:







    More in an album:
    http://imgur.com/a/xaMFv

    Some of the new features include:
    • Built-in object pooling for missiles (choose to use pooling or not)
    • Launcher script and custom editor inspector for managing launch options and settings for missiles
    • Create "missile launch nodes" on your GameObjects to specify points where missiles can fire from.
    • Set whether missiles should fly out to invisible 'nodes' first before they track their targets (for a specified amount of time) to create arcing missile patters (see screenshots above for examples)
    • Set randomness for missile arcing patterns where missiles will initially launch with a bit of randomness before homing in on their targets using the PID controlled targeting / flight
    • Manage existing launcher nodes on your GameObjects using the custom inspector (re-order, remove, create)
    • Allow staged launches and control the time in-between (e.g. 6 missile launcher nodes, fire each one in succession with a 0.5 second delay between each missile fired)
    • Missile Launch methods in code allow you to pass in arrays of GameObject targets (or just a single target in an array) and set whether missiles should randomly target the targets, or target them in order.
    • New demo scene
    The update should be ready sometime this week at which point I'll be submitting it to the asset store.
     
  25. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Version 1.3 is now submitted and should be out imminently after review! Some much requested features have been added in version 1.3:
    • Targetting by tag
    • Targetting closest objects by distance
    • Easy to use launch control from the main script editor
    • New demo scene to show the new features


     
  26. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
  27. ecequalsm2

    ecequalsm2

    Joined:
    Jan 14, 2016
    Posts:
    7
    This looks pretty cool! But, what if you have multiple targets to attack at roughly the same time? Is there a way to target all enemies on the screen with a barrage of missiles or is it only good for focusing on 1 target?
     
  28. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    You can pass in an array of target gameobjects and launch missiles - they'll target down all of those that were passed in :)

    You can see this in action in the web GL demo:

    https://hobbyistcoder.com/demos/2DHomingMissiles-Version1.3-WebGL/index.html

    Cheers!
     
  29. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    Long time since an update, but this is now updated for Unity 2018.2 and has a shiny new demo scene / example use demo added.

    A couple of new events are also added to allow subscription to missile detonate events (which give you the position data of the detonation) and missile launch events which provide the actual missile GameObject for subscribers to those events.

    Check out the recording of the new demo scene here:

     
  30. gamedevassets-sean

    gamedevassets-sean

    Joined:
    Jul 26, 2013
    Posts:
    76
    2D Homing Missiles version 1.8.0 has been released

    Updates

    This was a small release update to modernize the asset and provide support for newer Unity versions.
    • Published for Unity 2021 and 2020 LTS versions
    • Updated demo scenes to remove legacy UI (deprecated APIs) and replaced with Unity UI