Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Grave_sts on January 26, 2012, 09:02:41 AM
-
Hey all~
Is there a way I can get the current mouse x y z so that I can use this string and then convert it to a vector 3?
Then using this vector3 for a rotation value?
Thanks in advance
-
Check out the Get Mouse X and Get Mouse Y actions.
You can also get mouse movement with GetAxis and "Mouse X" and "Mouse Y" as the axis names. Or GetAxisVector if you need a vector.
BTW, the Action Browser has a search field, so you can type "Mouse" and instantly see all actions that have Mouse in the name.
-
Thanks~ I tried the get mouse x and y, but it is not giving me the desired result for some reason, that's why I was curious ;) Anyhow what I am trying to do is from the current mouse position spawn a prefab that is set to the angle of the mouse i.e so that it tracks the surface and spawns the object at the desired surface normal ;)
-
hi,
I think you need then a custom actions like this one:
http://hutonggames.com/playmakerforum/index.php?topic=272.0 (http://hutonggames.com/playmakerforum/index.php?topic=272.0)
It allows you to get the mouse position ( and drag) from a defined plane in the 3d space.
If the surface is actually a mesh, then you'll need to use raw raycasting instead.
Hope it helps.
Bye,
Jean
-
Thanks Jean~
I've looked at the example you made on raycasting and changed it to allow for an on clicking event to create a prefab, the only thing I seem to be missing the plot for is getting the created prefab to match the "hit visual's" angle ;)
-
No worries I got it to work~ ^^ Thanks for all the input guys really appreciate it :D~ You guys are legends ~!
-
Hmm, ok I did something and now whenever I change the prefab that gets created from the red rectangel to a mesh for instance, the alignment of the created objects goes funky...but if i seet the spawn object to the red rectangle it works perfectly ;<
Am I missing something? Or do I have to set the meshes transforms beforehand? As I tried freezing/setting a neutral pose...
Thanks again for putting up with my series of q's (http://i1264.photobucket.com/albums/jj488/Grave_sts/Rotation.png)
-
Hi,
you're gameObject mesh is simply oriented in a different way.
so the solution is to parent it to an empty gameObject that is oriented properly so that your mesh points in the right direction. Compare the axis orientation of my gameObject and yours, and match it.
Can you send me this mesh, and I'll create a working scene for you.
Bye,
Jean
-
Thanks Jean~ I really appreciate it :)~
Dropbox link: https://dl-web.dropbox.com/get/Mesh_test/Camlock_test.fbx?w=53bd9d81
>thanks again ><~
-
i followed your advice with regards to the parenting and angle setup and everything is working like a dream~ ^^ thanks again guys ^^