Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Disastercake on May 12, 2012, 04:44:26 AM

Title: [SOLVED] Issue with getting a mouse pick vector point
Post by: Disastercake on May 12, 2012, 04:44:26 AM
I'm using 2D Toolkit and Playmaker

The problem is that I'm grabbing a mouse pick point, but no matter where I click, it keeps moving to the same spot.  Below is a video of the issue.

Title: Re: Issue with getting a mouse pick vector point
Post by: Alex Chouls on May 12, 2012, 02:25:17 PM
It looks like you need to set the iTween Move To Position to use the stored v3_actionPoint.

Right now it's probably just going to 0,0,0.

BTW, if you check "Debug" in the State tab you can see variable values at runtime. This can help you track down what's wrong...
Title: Re: Issue with getting a mouse pick vector point
Post by: Disastercake on May 12, 2012, 02:29:35 PM
Thanks for the response Alex.

I think I kind of hacked a fix:

I created an invisible plane at Z = 0.  I think since I'm using huge Z value differences it's actually treating the Z value like a 3D plane with the V3 variables, even though visually in the orthographic view it looks the same regardless of Z value.

So placing this plane at Z = 0 allowed me to get a more accurate position for the cursor point.

Do you think there's a better way for this?
Title: Re: Issue with getting a mouse pick vector point
Post by: Alex Chouls on May 12, 2012, 03:00:11 PM
What were you picking against before? Using an invisible plane sounds fine (not really a hack, unless I misunderstand...)
Title: Re: Issue with getting a mouse pick vector point
Post by: Disastercake on May 12, 2012, 03:33:57 PM
I wasn't trying to pick against any specific object, because I assumed it would just work like 2D engines I've worked with before which check against the XY value of the cursor location.

It might have been checking against that map in the background, which is at like Z=100 so I can organize draw order more easily.