playMaker

Author Topic: Screen To World Point [SOLVED]  (Read 4497 times)

pjrm1470

  • Playmaker Newbie
  • *
  • Posts: 13
Screen To World Point [SOLVED]
« on: September 18, 2013, 09:02:57 PM »
Hi. I'm trying to convert the mouse position to the game world position. I'm making a Tank game so i want the cannnon to rotate on Y using the Vector3 position of the mouse, but when i set the X and Y position to the Action "Screen To World Point", my variable Vector3 is always (0.0, 0.0, 0.0).

Am i doing something wrong?
Attached images "FSM_MousePos1.jpg" and "FSM_MousePos2.jpg" to show the process. I created 3 variables:
  • Vector3 MousePointPos
  • float MouseXPos
  • float MouseYPos
those are visible on the Action!

Best regards,
PJRM.
« Last Edit: September 18, 2013, 11:27:05 PM by pjrm1470 »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Screen To World Point
« Reply #1 on: September 18, 2013, 09:18:53 PM »
Why not use Mouse Pick store the intersection vector3 with the floor?

I'm not sure why it is acting that way, have you tried using Normalized? Also, XZ is horizontal, so you're storing a vertical number in Y but looking from Top-Down.

*edit

Also :
http://hutonggames.com/playmakerforum/index.php?topic=4908.msg23062#msg23062
http://hutonggames.com/playmakerforum/index.php?topic=4918.msg23063#msg23063
« Last Edit: September 18, 2013, 09:20:58 PM by Lane »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

pjrm1470

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Screen To World Point
« Reply #2 on: September 18, 2013, 10:48:19 PM »
Why not use Mouse Pick store the intersection vector3 with the floor?

I'm not sure why it is acting that way, have you tried using Normalized? Also, XZ is horizontal, so you're storing a vertical number in Y but looking from Top-Down.

*edit

Also :
http://hutonggames.com/playmakerforum/index.php?topic=4908.msg23062#msg23062
http://hutonggames.com/playmakerforum/index.php?topic=4918.msg23063#msg23063
I didn't get it.
avoiding the subject of rotating the cannon, Mouse Pick and also Screen Pick doesn't work either to get the position of the mouse in the world position.

I couldn't find one example with this action (Screen To World Point) working on playmaker. Maybe if i do it inside a c# script and make a public variable to be get into the PSM.

What you think? Would be beter?

Best regards,
PJRM.

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Screen To World Point
« Reply #3 on: September 18, 2013, 11:23:34 PM »
Did you make sure your using the Main Camera?

pjrm1470

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Screen To World Point
« Reply #4 on: September 18, 2013, 11:26:11 PM »
Did you make sure your using the Main Camera?
how simple things change everything... That's it!!! Works.
Thank you - Topic solved

Best regards,
PJRM