playMaker

Author Topic: [SOLVED] Issue with getting a mouse pick vector point  (Read 2071 times)

Disastercake

  • Full Member
  • ***
  • Posts: 101
  • www.disastercake.com
    • View Profile
    • Disastercake
[SOLVED] Issue with getting a mouse pick vector point
« on: May 12, 2012, 01: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.

« Last Edit: May 12, 2012, 01:31:31 PM by Alex Chouls »
Soul Saga - Anime themed adventure RPG by Disastercake

http://www.disastercake.com

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3643
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Issue with getting a mouse pick vector point
« Reply #1 on: May 12, 2012, 11:25:17 AM »
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...

Disastercake

  • Full Member
  • ***
  • Posts: 101
  • www.disastercake.com
    • View Profile
    • Disastercake
Re: Issue with getting a mouse pick vector point
« Reply #2 on: May 12, 2012, 11:29:35 AM »
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?
Soul Saga - Anime themed adventure RPG by Disastercake

http://www.disastercake.com

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3643
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Issue with getting a mouse pick vector point
« Reply #3 on: May 12, 2012, 12:00:11 PM »
What were you picking against before? Using an invisible plane sounds fine (not really a hack, unless I misunderstand...)

Disastercake

  • Full Member
  • ***
  • Posts: 101
  • www.disastercake.com
    • View Profile
    • Disastercake
Re: Issue with getting a mouse pick vector point
« Reply #4 on: May 12, 2012, 12: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.
Soul Saga - Anime themed adventure RPG by Disastercake

http://www.disastercake.com