- Home /
Making a Touch TrailRenderer
Hey Guys thx for reading. I tried different things but non of them worked right till now.. Everytime the User touches the screen and moves it around it should leave a trail behind the finger as you can see it in many different mobile games like fe. Fruit Ninja. The answer may be banal but I really want this to work out right so Im asking you Pros. Every Answer is highly appreciated and please ask if something is unclear. Thx =)
Answer by DannyB · Jul 09, 2012 at 09:02 PM
Hi,
You can try one of the few gesture plugins. They are not free, but reasonably priced.
Input Touches - Demo is here and the store link is here. In particular, see the swipe example.
Easy Touch - Demo is here and the store link is here. In particular, see the one finger example, and swipe your mouse there.
If these didn't help, see Finger Gestures. A little pricier but belongs in this list.
EDIT: Here is how to do a mouse and touch trail with Input Touches plugin and Trail Renderer.
Open a project with Input Touches imported.
Make your camera orthographic.
Drag the Input Touches prefab (from the Input Prefabs folder) to your scene.
Create an empty object, and attach a trail renderer component to it.
Make sure you set up the trail correctly, with a proper particle material. If you don't have one, import the Particles standard package.
Make sure your empty object is properly positioned in the world. You should see a sample trail in the game window, when you move the object in the scene window.
If all up to here is good, add this script to your Trail game object.
Hope this helps.
I actually have Finger gestures and input touches but I just couldnt get through them because of the lack of tutorials. Its really not as self explaining as they think it is^^
I see. But the input touches should have an example of exactly what you need no?
Hey, thanks a lot for this answer, I'm using NGUI and want to draw the trail on my 2D (NGUI camera). When I use your code, the trail is drawn on the NGUI (2D camera it seems) however, I only see the trail in the Scene view and not the game view. Any reason for this? Thanks in advance.
Your answer
Follow this Question
Related Questions
Touch Hold for Power 1 Answer
2D Camera (Android, Iphone) 1 Answer
Trail renderer color always black 3 Answers
InputManager vs iPhone/Android 2 Answers
Replace Touch commands with mouse events 2 Answers