playMaker

Author Topic: PROPER IOS CAMERA ORBIT W/FINGER DRAG  (Read 4708 times)

BlueSquirrel

  • Playmaker Newbie
  • *
  • Posts: 6
PROPER IOS CAMERA ORBIT W/FINGER DRAG
« on: March 16, 2013, 02:56:57 AM »
Would anyone be able to provide a detailed outline on how to get a camera to orbit properly from one position with finger drag? I used the standard fps camera asset and tried to tweak a few numbers around and deleted controller movement script because the player will not have this option. The drag works okay, but when you lift the finger then touch a point again the camera jerks around to another x,y position on the axis. I'm trying to get it to start at the same point that I left off when I previously lifted my finger.
Perhaps I need to create an orbiting camera FSM from scratch using deltax and deltay. (but I have never worked with these attributed before)
Any help would be greatly appreciated!!
Cheers

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: PROPER IOS CAMERA ORBIT W/FINGER DRAG
« Reply #1 on: March 16, 2013, 03:36:59 AM »
I created a camera a few months ago (back when my game had these controls) its wasen't too tricky. What I ended up doing was using the touch position and feed that to a curve which set the camera rotation acordingly. Remember to set the new camera rotation to what it is once the user removed their finger.

I would post an image of my FSM but it includes my camera system and would confuse you. Let me know how you get on, I could rebuild it for you, but I'd suggest trying to make it yourself as I learnt a lot from building stuff myself (im no coder)


BlueSquirrel

  • Playmaker Newbie
  • *
  • Posts: 6
Success w/ new problem
« Reply #2 on: March 18, 2013, 04:03:19 AM »
Thanks LampRabbit,

I attempted to make an fsm from scratch and I finally got a rotating camera that stopped and started at same x,y position. Now the rotation is slightly off and doesn't rotate normally (lopsided orbit). I wonder if I can add this fsm to an already existing script. Perhaps it will work. I'll try and check back later!!

BlueSquirrel

  • Playmaker Newbie
  • *
  • Posts: 6
EUREKA - need to restrain Yaxis rotation parameters though
« Reply #3 on: March 18, 2013, 01:59:44 PM »
So I made a few adjustments to capsule and camera. I made touchX relevant to capsule and touchY relevant to camera. Only thing left to do is find a way to restrain y axis because I don't want player to rotate 360 forward and backwards. Maybe -60 and 60. Any thoughts on how to achieve this with actions?

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: PROPER IOS CAMERA ORBIT W/FINGER DRAG
« Reply #4 on: March 18, 2013, 09:42:26 PM »
Yes, but I'd need to see how your current system works (screengrab the network)

BlueSquirrel

  • Playmaker Newbie
  • *
  • Posts: 6
IOS CAMERA ROTATING RESTRICTIONS
« Reply #5 on: March 25, 2013, 03:44:31 AM »
Lamprabbit,
Sorry for late reply. Have been away from forum for some time.

Here is my setup:
IDLE[touch_began] (1)touch event:began)--->WAIT 4 MOVE [touch_ended;track_finger] (3)touch event:ended,moved, cancelled) --->
ROTATE[touch_ended;moving_stopped](get touch info,float multiply,rotate, (2)touch event:ended;stationary)