playMaker

Author Topic: Camera rotate around object  (Read 4105 times)

komponent

  • Playmaker Newbie
  • *
  • Posts: 2
Camera rotate around object
« on: August 15, 2012, 05:59:15 AM »
Hi all,

Just getting started looking into Playmaker to replace the bits in my unity project that were just hacked together from random code.

I am trying to get the camera to rotate around an object when a gui button is held down. I have it working so far that when you click it spins, click it stops, but it is not right yet.

I would use the RepeatButton command in Unity usually, but if I change the Style on the gui button in Playmaker from Button to RepeatButton, it gives me an error about not finding RepeatButton in skin GameSkin Repaint.

Anyone know how to sort this? I know it will be something small I have missed.


Attached are the state machines doing their thing.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Camera rotate around object
« Reply #1 on: September 13, 2012, 06:51:42 AM »
Hi,

 it's because I suspect it doesn't exists. What could be happening is that the repeat button is a special component that indeed use the normal button skin.

I would think that in a real world project that doesn't matter much, since you would need to create a skin anyway, then you can create your own repeat button.

 also, could you explain what's not working on your rotate feature, you seem to say it's not working well also.

bye,

 Jean

komponent

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Camera rotate around object
« Reply #2 on: September 14, 2012, 09:52:13 AM »
Hi Jean,

Thanks for the reply.

At the moment when you click my rotate button the camera will start to rotate, and will continue to rotate until you click the button again.

What I want is the user to hold the camera rotate button down to rotate the camera, and let go to stop.

Any ideas?

Thanks

-jaime

Sjones

  • Full Member
  • ***
  • Posts: 203
Re: Camera rotate around object
« Reply #3 on: September 14, 2012, 10:06:07 AM »
i hanvt used mouse input at all but if its the same as touch then end the fsm on mouse up, this should stop the rotation

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Camera rotate around object
« Reply #4 on: September 15, 2012, 04:35:47 AM »
Hi,

 well.. gui button only sends an event when pressed. so to check when the button is release, you should simply  watch the mouse button up using "getMouseButtonUp", and use that in your state that currently rotates, that way you will be able to stop the activity currently triggered by a button.

bye,

 Jean