playMaker

Author Topic: Stop FPS Camera Rotation  (Read 1745 times)

thierry_st_malo

  • Junior Playmaker
  • **
  • Posts: 58
Stop FPS Camera Rotation
« on: April 27, 2015, 09:08:00 AM »
Hi, I'm a newbie with PlayMaker, so my question is probably ridiculous. Sorry about that.

Following this link :
http://hutonggames.com/playmakerforum/index.php?topic=47.0
I've created an FPS Controller. Everything is fine, except that when I start rotating my camera, it keeps rotating forever and ever unless I hit very quickly the other direction's key.
But I want the rotation to stop instantly as soon as I release the key ( by the way this is what happens with tranlation ). How can I do that ?

Thierry

P.S : I use Unity 5.0

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Stop FPS Camera Rotation
« Reply #1 on: April 27, 2015, 10:46:52 AM »
Key and Button Presses come in 3 flavors. Get button Down and Get button up are both  basically a Boolean state that can only be true for a quick moment . Get Button  will be true while you hold the button.
So try something like state1 (Get Key ) goto state2 and rotate in desire direction but  (on key up) go back to state1.
« Last Edit: April 27, 2015, 10:50:38 AM by redikann »

thierry_st_malo

  • Junior Playmaker
  • **
  • Posts: 58
Re: Stop FPS Camera Rotation
« Reply #2 on: April 28, 2015, 09:12:20 AM »
Thanks, Redikann :-)