playMaker

Author Topic: 2D Rotation on Z axis [SOLVED]  (Read 5073 times)

MIKMANNER

  • Playmaker Newbie
  • *
  • Posts: 10
2D Rotation on Z axis [SOLVED]
« on: January 23, 2012, 03:16:35 PM »
Hello - I have a scene set up where my camera is looking at the 'back' perspective. I want my gameobject to rotate at the mouse position on its Z axis.

I can't work it out, how do I store the mouse X,Y position and set the Z angle to look at it?

Thanks for any help :)

Mik
« Last Edit: February 29, 2012, 01:41:26 PM by Alex Chouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 2D Rotation on Z axis
« Reply #1 on: January 24, 2012, 01:37:28 AM »
Hi,

 Can you describe what you have tried so far?

You need to use my magical custom actions for this :)

http://hutonggames.com/playmakerforum/index.php?topic=272.0

This action allows you to track the mouse position on a plane. So, set up this action and the plane to be your XY and you will then retrieve the mouse position in that plane. you then can have your gameObject looking at this position or compute the angle you want between the two.

If you struggle, let me know, I'll do a working example and send you a unity package.

Bye,

 Jean


MIKMANNER

  • Playmaker Newbie
  • *
  • Posts: 10
Re: 2D Rotation on Z axis
« Reply #2 on: January 27, 2012, 01:52:44 PM »
That's excellent thanks!

Hi,

 Can you describe what you have tried so far?

You need to use my magical custom actions for this :)

http://hutonggames.com/playmakerforum/index.php?topic=272.0

This action allows you to track the mouse position on a plane. So, set up this action and the plane to be your XY and you will then retrieve the mouse position in that plane. you then can have your gameObject looking at this position or compute the angle you want between the two.

If you struggle, let me know, I'll do a working example and send you a unity package.

Bye,

 Jean