- Home /
Parabola Style Laser
Hello,
I would like to create the "bezier style laser effect", like the most of the games to fire bombs, items or put on a target at some enemy.
The effect I've seen it with particle system and simple lines ... anyone know how I could do it?
I have images with the example!
Thanks, Deo.
I want to do it's the Parabola with a Height, the effect I watched with particles and just with a simple or animated texture, but the main idea it’s lear how to create by scripting the parabola ...
Here are the videos with References about the parabola effect:
Rochard: http://www.youtube.com/watch?v=Zre5vCiEAFM
1:20min Partcle Parabola Energy. 1:40min Parabola with a Animated Texture. Rachted & Clanck: http://www.youtube.com/watch?v=NlXYuUp9588
4:30min Parabola throwing bombs. Thanks,
Thank all of you guys,
The main idea it's create a Parabola with Start From (Player) to Target (Enemy Pos), with a Height in where the player can throw a Bomb with the trayectory of tue Parabola, and this parabola we can move it dynamically draw it with a animated or simple mataerial.
I don't know if in Rochard Game when use Energy that Ray are particles or just a Render Line, but the effect it's super nice, but in this case I just want to know hot to do it with a animated or simple material.
What do you think about it.
Thank you so much for any Help! :)
Deo
Do you need this as a static effect (like a preview for a ballistic curve) or do you just want an object to have such a ballistic curve and draw a tail behind it?
Some of those are projectile trails while others are static; some of the static ones seems to have an animated texture (the arrow ones). It's a matter of implementation - a trail solution would work on a moving object but not be appropriate for a constant flight path preview, for example.
Hi there,
Thanks for trying to help me, the think that I want to do it's the Parabola with a Height, the effect I watched with particles and just with a simple or animated texture, but the main idea it’s lear how to create by scripting the parabola ...
Here are the videos with References about the parabola effect:
Rochard: http://www.youtube.com/watch?v=Zre5vCiEAF$$anonymous$$
1:20$$anonymous$$ Partcle Parabola Energy.
1:40$$anonymous$$ Parabola with a Animated Texture.
Rachted & Clanck: http://www.youtube.com/watch?v=NlXYuUp9588
4:30$$anonymous$$ Parabola throwing bombs.
Thanks,
Deo.
You can also make the parabola with GL.Lines or GL.Quads. Just setup the parabola as a chain of points, then you can animate the line material over time to make the decay effects. This way you can easily make the shape dependant on the distance. If say the parabola equation is a*x**2 + b*x + c, then a depends on gravty and would be the same for all tracks, c will depend on the distance.
sounds like you would want to plot a series of points that could then be used as points for a LineRenderer
http://docs.unity3d.com/Documentation/Components/class-LineRenderer.html
as for the equation to plot the points itself.. I am going to have to play with this for a bit..
UPDATE: I'm working on figuring this out, nice question! (but I never took trig, so this may take a while..)
http://www.mathisfunforum.com/viewtopic.php?id=1673
this guy did a nice job of laying it down simply.. now I'm going to figure out how to apply it! TBC ;)
Answer by Seth-Bergman · Dec 31, 2012 at 07:02 AM
I have been playing with this like I said..
my project is not very pretty yet, and I am still not sure exactly why I had to hedge my vertical rotation... but here is a sample project which I am currently still working on:
https://dl.dropbox.com/u/11203897/MyTester.rar
open the scene and hit play, then use the arrow keys to rotate around (up,down,left,right), and space bar will revolve the camera.. This all works.. though I had to add one value to my equation which I still don't get..
take a look, and I will keep playing with this,and update if I figure more out..
if you select the Cylinder in the hierarchy, you will also be able to adjust the projectile velocity dynamically, as well as the gravity, or the number of points of the line.
(I also added a sample platform to demonstrate how to shorten the line if it hits something)
:)
EDIT:
UPDATED ----
pressing space will now launch a projectile with the initial direction/velocity (and will also update the project gravity if necessary), in order to demonstrate the ACTUAL project rigidbody physics versus my approximation.. you will see it is pretty close, but not PERFECT.. as @Bunny83 mentioned before, predicting EXACTLY would be tricky... (though if anyone can see how to fix my math, please do tell..)
however, we would really want this to be exact (generally) for the game, so it's better to just use the plotted trajectory.. since it's pretty darn close, it'll look ok... to launch a TARGETED projectile, press "x". This gets passed the actual array of points which we are already using to draw the arc, and then uses those as waypoints, so we KNOW it will ALWAYS be exact.
I didn't bother to fix the minor glitches, it's enough to get the idea..
UPDATE:
the project in the link is updated, just added some sample textures and a simple editor window to adjust things.. just use file bar > Window > Laser Trajectory .
I will probably update this (at least) one more time when I feel like it, at which point I'll post it on the wiki (with a link here).. for now, just thought I'd post my progress :)
Great, thank you so much, im going to check it righ now!
also note that I did not add any material to the line, but you can do so to get the nice effect you want!
Yes, dont worry for a first watch looks really nice and wat I need :) ... really thanks for your time!!
$$anonymous$$y pleasure, thanks for the fun question! (if it does solve your question, please be sure and click the check mark to accept it)..
I am still not quite done with this, so I will update my link and leave a comment when I'm ready.. :)
fantastic project, Seth. so many people want this sort of thing maybe off to the asset store for 2013 ??
Your answer
Follow this Question
Related Questions
Lightaber effect? 0 Answers
Particles to fire up instantly? lasers! 2 Answers
Laser beam using particle system Unity2d. 0 Answers