Playmaker Forum

PlayMaker Help & Tips => PlayMaker Tutorials => Topic started by: holyfingers on August 05, 2013, 11:42:56 AM

Title: Point-and-click Interface...
Post by: holyfingers on August 05, 2013, 11:42:56 AM
Currently working on a graphic adventure in Unity, only started using Playmaker a few months ago but I just finished a quick write-up of how I've implemented a basic point-and-click interface and would love to get some thoughts and feedback...

http://www.holyfingers.co.uk/main/blog/2013/07/31/pointing-and-clicking/

Cheers,

Nick.
Title: Re: Point-and-click Interface...
Post by: jeanfabre on August 06, 2013, 04:36:09 AM
Hi,

 Excellent! Thanks for doing such detailed tutorial. The way you created screenshots for playmaker fsm is great and clean! I really like it.

 questions:
-- how did you do the mouse white spot and trailing on the video?

-- where can we play a demo?

bye,

 Jean
Title: Re: Point-and-click Interface...
Post by: holyfingers on August 06, 2013, 05:40:36 AM
Thanks Jean!

Thought I might have got a bit carried away with the colour coding, glad it was still legible!

The cursor is a small white sphere with a trail renderer attached, it's updated with the following script which I just grabbed from http://answers.unity3d.com/questions/35005/transforms-position-wherever-the-mouse-is-pointing.html (http://answers.unity3d.com/questions/35005/transforms-position-wherever-the-mouse-is-pointing.html)

Code: [Select]
#pragma strict
var distanceFromCamera : float = 10;

function Start () {
}

function Update () {

var screenPoint : Vector3 = Input.mousePosition;
screenPoint.z = distanceFromCamera; //distance of the plane from the camera
transform.position = Camera.main.ScreenToWorldPoint(screenPoint);
}

It's not a perfect solution, at the moment I have to manually correct the size of the cursor if I change the field of view of the camera, which is a bit annoying, but it woks for the most part.

There's no demo as yet, I'm hoping to get something playable in the next couple of months though. I'll be using Playmaker in conjunction with 2DToolkit and EasySave2 for pretty much everything, working on the UI and inventory system in the next few weeks so I'll post a similar write up for them when I'm done.

Thanks again Jean!

(Also, thanks for all the stuff you do around here, there's no way I could be making a game without Playmaker and all the help and support in this forum!)
Title: Re: Point-and-click Interface...
Post by: sebaslive on August 07, 2013, 07:00:30 PM
Great tutorial! Thanks for this it's very well documented and any tutorials with pathfinding are a must have!
Title: Re: Point-and-click Interface...
Post by: MarkD on August 08, 2013, 03:30:07 AM
I would love to read more about how you're using playmaker for creating an inventory system!  If you wouldn't mind updating this thread when you post that information that would be great!

Title: Re: Point-and-click Interface...
Post by: holyfingers on August 08, 2013, 04:41:08 AM
Thanks folks, glad you found it helpful. Will post more set-ups as I figure them out, writing up processes like this is a good way of keeping me organized!   
Title: Re: Point-and-click Interface...
Post by: holyfingers on August 27, 2013, 12:55:35 PM
Added another post, this time on implementing a very simple inventory system:

http://hutonggames.com/playmakerforum/index.php?topic=4780.0
Title: Re: Point-and-click Interface...
Post by: Alex Chouls on August 28, 2013, 01:41:42 PM
Fantastic work! Love it :)
Title: Re: Point-and-click Interface...
Post by: holyfingers on August 28, 2013, 03:30:26 PM
Thanks Alex, glad you like it, will be adding more as I go along! :D