Topic: Adding motion trails to moves and controlling them through frames

Hi, I would like to implement weapon trails to the moves of my characters.  I dont know which scripts I need to edit or how to achieve this effect.  Currently for the weapon trail to work; I attach the motion trail script to an object (i.e. a sword), and define a base and a tip. 

I want this feature to work for both weapons and limbs

What I would like to do is activate the component of a character that has this script during certain frames of a move.

Re: Adding motion trails to moves and controlling them through frames

i'm reading about trail renderers now because i want to use them too to make some effects more dramatic... but i still don't know how to make them work only in some animations and bone parts.

[media]https://www.youtube.com/watch?v=IKjeU_mcla8[/media]

Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.

Re: Adding motion trails to moves and controlling them through frames

alright, been doing some tests... the effect is cool, it's an empty object with a trail renderer inside, and it's embed to a bone in my prefab character, in this case, a bone in the katana, the problem is it's always on, and for some moves it gives a strange effect... maybe there's a way to make the object transparent all the time and turn it opaque when in certain animations....

http://s5.postimg.org/lp9jb8ak7/trail.jpg

Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.

4 (edited by shubi 2015-02-27 14:51:26)

Re: Adding motion trails to moves and controlling them through frames

Hello smile

There is a very simple, but powerful solution:


1. Create a GameObject with Trail-Renderer
At first create an empty GameObject in your scene with default position, rotation and scale (0,0,0 / 0,0,0 / 1,1,1). Now assign the Trail-Renderer component to that object and select a material for the trail-mesh.
Drag that GameObject in your PreFab-folder or somewhere else in your Project-window and delete the GameObject in the scene / hierarchy-window.

2. BugFix
Have a look at this post from YumChaGames  : http://www.ufe3d.com/forum/viewtopic.php?id=61
Change the ControlScript.cs as shown in the post. Maybe you need to change "getTransform" to "GetTransform" in the code snippet, because I had an error with "getTransform".

3. Edit your Moves
Now select the move(s), where you want to have some trail-effects. Open up the animation-preview and choose the starting frame. Then create a new Particle Effect:

http://s11.postimg.org/581ozqus3/trail2.jpg

Choose your Trail-PreFab from Step1 and select a body-part to place the trail. Adjust the offset-values and play around with the duration of the effect. Don't forget to check "sticky" wink This option only works with the BugFix from step 2.

If the trail looks ugly and not smooth enough on very fast motions, you can check this asset: https://www.assetstore.unity3d.com/en/#!/content/16076 or use sticky particle effects instead (they look much better in my opinion).

BTW: You can use the Particle-Effect-Options in the move-editor for all kind of stuff. It simply generates GameObjects from a PreFab at runtime at a specific frame, for a specific duration. So you can put scripts in your PreFab and controll anything you like.

shubi's Website

Share

Thumbs up +3 Thumbs down

5 (edited by StriderSpinel 2015-02-27 23:45:49)

Re: Adding motion trails to moves and controlling them through frames

Good to know there's a Bug fix.... I knew about this parameter and tried to use it, but it didn't work as i wanted and even in the documentation they say they recommend not using it... NOW LET's ROCK! Thanks Shubi!

Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.

Re: Adding motion trails to moves and controlling them through frames

Thanks for your help guys smile.  Yum Cha Games posted his method of adding motion trails to the move editor and I feel this method is the best approach.  I was trying to manipulate the effects with animation events but that lead to a hack way of achieving motion trails. 

He posted his method in this thread here big_smile

http://www.ufe3d.com/forum/viewtopic.php?pid=1271#p1271

I implemented his mods into my project and it's beautiful.  Trailer coming soon!