Image
Top
Menu
May 3, 2011

Touch to Mouse Input Converter for PlayMaker on Unity 3D #unity3d #gamedev

If you are using PlayMaker plugin for Unity3D and are struggling with touch input in your game built with mouse events, I made a FSM to convert touch input into mouse input in my project so that it will work on my Mac and iPhone at the same time. Just drop the prefab into your scene, or create a GameObject, add FSM, and paste the template in the .asset file.

Download link: http://ge.tt/57U7eII

Basically, when a user touches the screen (Touch Began), this FSM will send a MOUSE DOWN event to the object touched, and send a MOUSE UP event to the object touched when the user lifts his/her finger (Touch Ended).

Posted via email from Next Level with Brandon

  • http://twitter.com/mariovermeulen Mario Vermeulen

    thanks, just the thing i was looking for, and great video on your blog (Fifty questions)!

    • http://www.plinan.com Brandon Wu

      Great! By the way PlayMaker now has even more touch input events compared to when I wrote the post so make sure you check those out as well. Cheers!

    • http://www.plinan.com/ Brandon Wu

      Great! The current version of PlayMaker also has more touch input features so make sure you check those out as well!

  • noob

    Hey, I’m trying to use you prefab, but there’s no scritp attached to it, none script came with the dowload…

Posted By

Categories

Blog Posts, Unity3D

Tags