Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ArcReactor procedural ray generator

Discussion in 'Assets and Asset Store' started by CatsPawGames, Jun 4, 2014.

  1. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Cool an interesting the new update with these new fire rays, like it

    Thanks for explaining but I will have to test and see it to be able to understand what you are saying, as I am a beginner in Unity.

    Maybe if you can explain it from a beginner point of view and not from an expert like you I could understand it more, sorry that I do not know the enough experience and knowdlege as you have and I admire much your expert work and what you can do and how you do it.

    When you say "invoke LaunchRay()" means that I need to make some scripting for it to work? I am sorry that I do not know nothing about scripting, so I can not do a script to make it work if this is needed, this is why I told to use premade prefabs that probably do not need any scripting

    OH!!! yes, hitting Q key it appears something, and also when using the mouse button to fire, you are right that is not intuitive as it would help much to have a text on screen telling what can be done, cool

    Thanks for explaining the differences between Unity 4 and 5 versions, I will test it and tell you if I find something that does not work in Unity 5
     
    Last edited: May 30, 2015
  2. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Concerning scripting and pre-made prefabs, it goes like this:

    You can use ArcReactor component itself without any scripting by providing either array of static points for effects with static shapes, or array of transforms(objects from your scene) for dynamic effects (see showcase on demo scene #1 for examples). Moving provided transforms is entirely up to you, you can use physics, scripts, tweening components etc.

    However, if you want to use built-in Launcher component(mostly used for weapons and other gameplay-affecting cases), you should be able to write at least basic code.
     
  3. seansteezy

    seansteezy

    Joined:
    Nov 28, 2013
    Posts:
    122
    Hey there CatsPaw!

    I have a little question and I think I know how to achieve this effect, I am attaching an image, the blue laser hits an object and stops. I know that when the ray hits something you provide callbacks for that, which I can then manipulate the fade point to be the distance from the object the ray is hitting to the hit.point. Is their an easier way or do you think that is the best way to do so? Thanks for your help and sorry if someone already asked, I skimmed...

     
  4. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello, I'm not sure what you're trying to achieve there. If you need ray with fading on the end, there's no need for callbacks etc., fade point is calculated from the end of the ray as it is. Probably I'm missing something, so can you elaborate?
     
  5. seansteezy

    seansteezy

    Joined:
    Nov 28, 2013
    Posts:
    122
    Yes, I'm sorry, so I'm using the ray as an aiming guide for guns in a top down shooter, but right now it just goes through every object, and I want it to stop when I hit a wall, or enemy or whatever. Basically stop when it hits a collider instead of going until the end of the transforms I have setup... thinking out loud about it, I suppose I could move the transform to the distance away from whatever the ray collides with... then I can add fade at the end if I want... ok I think I'm good :) Thanks! I picked up STS too, very cool, so I'm using your lasers and your see through system in my game :) I'll be sure to leave some ratings and reviews too!
     
  6. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Just include layers of objects that need to stop your ray in "Layers" parameter of Launcher, it will do everything else for you :)
     
    seansteezy likes this.
  7. seansteezy

    seansteezy

    Joined:
    Nov 28, 2013
    Posts:
    122
    Ah, awesome :) Thanks again! Your assets are superb!
     
  8. GeorgeGkas

    GeorgeGkas

    Joined:
    Jul 7, 2015
    Posts:
    3
    Hello, I want to point out that, it would be nice if you can make video tutorials (I have version 1.4).

    And something else. I correctly develop a 2d game and I want to use a "gun" with a laser in it. So it would be nice to get an idea in using the asset in 2d development. (more video tutorials on you)
    And my last question. I want when the laser touch an object (it could be any 2d or 3d object) to interact with it (like to destroy it, etc) How do I program a script to do that job. I want the script to added in the object-to-destroy.

    Thank you very much,
    GeorgeGkas
     
  9. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello.

    Why do you have version 1.4? Version 1.5b is available for a long time on Asset Store, and I recommend you to update.

    As for 2d development, I recommend you to wait about a week - version 1.6 should be available by then, and it includes Launcher2D component (I want to apologize to users that's been waiting for this update for a month).

    Your other questions answered in the manual, particularly in section about Launcher helper component. To destroy objects etc., you'll need to use ArcReactorHit events that Launcher provides. You can also try seeing how effect gun works in demo #1. Events are used in demo #3.

    I plan on doing beginner tutorial for ArcReactor, but I can't give you ETA on this.
     
  10. GeorgeGkas

    GeorgeGkas

    Joined:
    Jul 7, 2015
    Posts:
    3
    Thank you very much. As for the outdated version, I was away from Unity some time now. I just came back a few days ago and haven't check all the new staff. I think that I'm outdated too. o_O
     
  11. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.6 is approved and available on Asset Store!

    Changelog:

    - Fixed constant GC generation by idle Launcher
    - Added Launcher2D which supports 2D colliders
    - Added simple 2D game demo scene with reflections
    - Added ArcReactor_Trail component - alternative to Launcher. It will draw shape based on movement of GameObject
    - Added trails demo scene
    - Fixed Android fade bug.

    16_forums.jpg
     
    rxmarccall and hopeful like this.
  12. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Umm, I just updated to this new version..... I noticed that my ray is no longer only rendering up to a point like terrain or a wall like it was before, it just continues through visually. I opened the Dmoe4_2D scene and the flame effect goes through the floating gray barricades, is that intentional? Or is something wonky?
     
  13. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    It certainly is not intentional. Please try to import ArcReactor to new empty project and see if this problem persists. Most likely it's a problem with layers, check "Layer" parameter in your ArcReactor_Launcher settings and see if it includes layers of your terrain and walls.

    If this wouldn't help, please send me downloaded unitypackage, I'll take a look at it - maybe there were some problems during submission to Asset Store.
     
  14. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    I made a new project and it functions correctly in the Demo scene so it must be something with my Layers, I'll take a look at that.
     
  15. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    hi. interested with this asset but i have few questions.

    1. what would be the best way to use this system in pooling. i want to use this system as my weapon fire but i dont want to instantiate every time i fire. after reading the thread the best way is to use a clamp option and then freeze un freeze.. setting the offset to 0... but what about the particle emissions ? is there some way to pool that as well? how about integration of poolmanager asset?

    2. is there way to do a fade on the both ends?

    3. do you think i can yse this asset as a trail for a bullet? bullet is considered to be almost instant hit like a ray so it is just to show some air bending, smoke like trails along the path of a bullet.

    thanks.
     
  16. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello.

    1) Pooling is certainly an interesting topic. It depends on whether or not you're going to use Launcher component (automatic raycasting, reflections, hit/touch/reflect messages).
    If yes, then clamp and freeze are probably your best bets. Particles can be controlled through emissionOptions.emit boolean variable, just set it to false when your ray is inactive, particle system for that arc will not be destroyed but there will be no emission happening.
    If no, then you can probably just disable your ray systems when they're not used, along with particle systems (you'll need to expose emitterSystems array for that if you have EmitAfterRayDeath option enabled - otherwise they will be disabled automatically with ray system).
    I'm not considering integration with poolmanager since keeping up with changes will become very tiresome after some time, and it will probably cause conflicts between versions. I might make my own pooling solution for ArcReactor though, there's nothing complicated about that.

    2) Currently that's possible only through shape texture, which obviously isn't most flexible or comfortable way to do that. Although I already wrote new shader for 1.7 version, and there's option for front fade in it.

    3) Never tried it. Trail component itself should work fine with that and it'll generate needed shape, but you'll need to setup new visualization for bullet effect since I don't think any of built-in prefabs will fit that. You can probably use soft swirling spirals to visualize bullet rotating as it flies through air and main beam with smoke particles and noise texture, although I can't guarantee that it'll look good.
     
  17. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    DARN .. i lost chance to buy this during sale.. waiting for reply from author,.. darn. any last min discount coupon? xP
     
  18. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Sorry, but there's no discount coupon option on Asset Store, and there weren't any sales during last 2 months, so you didn't lost your chance :)
     
  19. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Was this not on sale few days ago? 24hours deal? I am sure that is how I found about it.
     
  20. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    No, last time ArcReactor was on sale in April.
     
  21. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I am having a bit of issue with trying to implement my own pooling system with Arc Reactor, without using a launcher.

    I wanted to disable the arc once they are "not used" anymore, but is there any way I can know when it happens?

    What I mean is that when arc reaches it's end of drawing duration, I want to be noticed or want arc to disable themselves when it happens (instead of destroying) Also I think particles can still be showing after that so I need some better way to "detect" if ray's duration has passed as well as particles are all done emitting and their life time has been passed. Only then I want to disable the game object with the arc reactor script.

    I am not sure what the best elegant way I need to do this.
     
  22. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    And I can really use the start fade option if you are happens to be working on that.. a laser shot with harsh beginning cut look on line renderer is just not cool.
     
  23. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Monitoring reaching the end of arc system lifetime is easy - enable "Playback messages", and ArcReactor component will send "ArcReactorPlayback" message to gameobject in "Message reciever" slot when it reaches end(or beginning) of its lifetime. ArcReactor will pass itself as parameter in that message.

    As for particles, that depends on if "Emit after ray death" parameter in emission options turned on or not. If it's on, then particle system will be placed independently of ArcReactor parent gameobject, and it will be destroyed after 1) ArcReactor gameobject is destroyed and 2) no particles are left. You can expose "emitterSystems" array as public if you want to handle particle systems yourself.

    If "Emit after ray death" is turned off, then particle system will be parented to ArcReactor gameobject, in which case you shouldn't worry about managing them, but particles will disappear once you disable ArcReactor gameobject.
     
  24. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Just wanted to post and explain what my issue from earlier was. Upgrading to the newest version of Arc Reactor made it so my lasers weren't colliding, I realized that there is now a 2D component, changing over to that I'm now getting my laser behavior like before. Hope that helps someone else that is working with Physics 2D.

    One other thing I wanted to bring up, is that the Lights along my rays are acting very strange after the update. I get super bright light points that are not evenly spaced along the ray, just clumped together in the first small distance of the ray. I'm attempting to mess with the light options but can't get it to look nice
     
    Last edited: Jul 29, 2015
  25. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    I'll take a look at lights, but light placing algorithm hasn't been changed since version 1.0. It would help if you provide screenshot of scene editor window with lights gizmos on.
     
  26. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353

    So looks like there are light nodes along it evenly, but you'll notice the ones towards the middle are not lighting properly, perhaps they are on a Z position that is behind my background sprite?
     
  27. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    That might be it. You can also try to change lights priority, Unity can disable rendering of lights with low priority by itself (renderMode parameter in lights options).
     
  28. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Hmm, yea just can't seem to get the lighting looking good anymore, just going to disable them and abandon it for now.
     
  29. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    You can also send me some test scene with this problem present so I can look at it.
     
    hopeful likes this.
  30. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Cats , are you experimenting with fade in option in anyway?
     
  31. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    As I said earlier, shader for front fade is ready and will be included in version 1.7. If release of this version would take too long, I'll consider releasing front fade as separate small update.
     
  32. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Arhh, I see. Thanks for that! Sorry if I didn't catch what's coming for 1.7, do you have some details on what we can expect from 1.7?
     
  33. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Plans for 1.7 include some minor optimizations here and there, front fade, 2 new effects and arc branching if it's viable from performance POV.
     
  34. Agent000

    Agent000

    Joined:
    Feb 12, 2015
    Posts:
    9
    I'm considering getting this for my project. A couple questions:
    - I'd assume it allows customization like specifying what types of surfaces rays reflect off of (i.e. the rays don't automatically bounce off everything), is my assumption correct?
    - Does it require Unity Pro to be fully usable?

    Thank you!
     
  35. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Yes, you can designate reflectors by layers or by individual objects for each individual launcher. There's more in-depth info in the manual, but it's just 2 simple parameters in Launcher component settings.

    All features are available on both free and pro licenses for both Unity 4 and Unity 5 versions.
     
  36. Agent000

    Agent000

    Joined:
    Feb 12, 2015
    Posts:
    9
    Awesome, thanks for the quick response! I think I'll be picking this up tomorrow!
     
  37. Agent000

    Agent000

    Joined:
    Feb 12, 2015
    Posts:
    9
    Also, if I use this for a commercial project, how should I credit you?
     
  38. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    You don't have to, but if you want, you can simply mention "ArcReactor rays by CatsPawsGames".
     
  39. Agent000

    Agent000

    Joined:
    Feb 12, 2015
    Posts:
    9
    Actually, one more question: does your ray system have a way to change the properties of a ray somewhere in the middle of its path? For example, say I shot a white beam through a piece of red glass, and wanted the beam to come out red on the other side. Would there be a way of doing that without spawning an entirely new beam with the changed properties?
     
  40. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    You can designate colors only for start and end points of the beam - colors inbetween will be interpolated. So, changing color at arbitrary point on ray is impossible. Theoretically you can try playing with start and end colors to achieve something close, but best way of doing that will be, as you suggested, spawning new beam.

    Edit: I thought about it some more, theoretically you can modify ArcReactor shader to accept intermediate color, and set material parameters at runtime. It would require some knowledge of shaders and math, and will decrease shader performance, but it's possible.
     
    Last edited: Aug 12, 2015
  41. Agent000

    Agent000

    Joined:
    Feb 12, 2015
    Posts:
    9
    Alright that's fine, I'm just spawning a new beam for reflections. Though I'm running into this weird bug:

    upload_2015-8-13_22-3-38.png

    While firing the beam if I move it onto the mirror, it triggers the game to spawn in a new beam as the reflection. For some reason though that new beam spawns with 2 ArcLineRenderers, one of which is the correct beam and the other is a "ghost" of where the beam was the moment before I moved it onto the mirror. My Beam prefab is set up to have a BeamArc object as a child, which is just a container for the ArcReactor_Arc script. I have no idea why, when it's spawning a new beam to reflect off the mirror, the container object ends up with two ArcLineRenderer children in the first place (you can see Beam(Clone)(Clone) and its children at the bottom of the hierarchy there), and why one of them acts so strangely (as you can see from the picture -- the beam on the right shouldn't be there.) Any help is appreciated!
     
  42. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    It's hard to tell what's going on without looking at your scripts since you handle spawn of additional beams yourself, but I can make a guess:

    Probably, you instantiate the second beam from the original beam (that's where (Clone)(Clone) name comes from), and it causes it to generate new LineRenderer since it's a new instance of ArcReactor - but old LineRenderer is still there since beam was spawned from already running ArcReactor beam. Solution is simple - spawn your beams from prefab, not from already existing instance.
    Edit: You also will need to copy lifetime parameter from original beam to freshly spawned beam to make them synchronous.

    PS: Btw, reflections like that can be handled automatically by Launcher without any additional scripting. I understand that you need additional behavior such as changing color, just a reminder for other people reading this thread.
     
    Last edited: Aug 14, 2015
  43. Agent000

    Agent000

    Joined:
    Feb 12, 2015
    Posts:
    9
    :D Thank you it worked! I should've been tipped off by the (Clone)(Clone) thing.
     
  44. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    My (not-so-reliable)hosting killed arc reactor site that was hosting demos and manual, so they are unavailable right now. I'm in the process of moving materials to my own server, new links should be up at the beginning of next week.

    My apologies to people who was trying to access demos or manual.
     
  45. cfree

    cfree

    Joined:
    Sep 30, 2014
    Posts:
    72
    Hi CatsPawGames!
    Your site is off? I want to test the 2D demo before i buy the asset, but i cant access the links :)
     
  46. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Sorry, forgot to update links in forum post after migrating from old hosting. Links should work now.
     
  47. cfree

    cfree

    Joined:
    Sep 30, 2014
    Posts:
    72
  48. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Link works for me, try clearing your browser cache. Also, you need to enable NPAPI plugins if you're using chrome.
     
  49. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Looks like links worked for me because it was routed locally, sorry about that. Server is inaccessible from external networks. Currently working on that.
     
  50. Kai_Zu

    Kai_Zu

    Joined:
    Dec 14, 2013
    Posts:
    17
    Screen Shot 2015-09-03 at 09.23.50.png
    Hi there!

    I have a weird problem. I use the PreFabs you've supplied, changed the ray type to 'Looping' and defined that there are two points in the ray, and increased the size multiplier to 4. No other changes.

    Now when I instantiate the ray, set the shapePoints[0] and [1] the ray somehow rotates itself in world space and points to wrong direction. The wrong direction is not random but rather it seems to be systematically +-X degrees from straight up, down, left or right where X is the true direction of the vector between the shapePoints.

    I know this because I added a Unity LineRenderer-component to my GameObject that contains the ArcReactor_Arc-component. And in the method where I assign Vector3s to shapePoints I set the LineRenderer's positions to shapePoints[0] and [1]. Please see the attached image. The thick solid line is the LineRenderer's doing and the bubbly line is an ArcReactor_Arc.

    I reimported your asset just today and am using Unity 5.1.2f1.

    Weird, huh? Any ideas?

    Thank you already in advance for your cooperation,
    Kai_Zu