Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: pjrm1470 on September 18, 2013, 09:02:57 PM

Title: Screen To World Point [SOLVED]
Post by: pjrm1470 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:
those are visible on the Action!

Best regards,
PJRM.
Title: Re: Screen To World Point
Post by: Lane 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
Title: Re: Screen To World Point
Post by: pjrm1470 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.
Title: Re: Screen To World Point
Post by: redikann on September 18, 2013, 11:23:34 PM
Did you make sure your using the Main Camera?
Title: Re: Screen To World Point
Post by: pjrm1470 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