Playmaker Forum
PlayMaker Help & Tips => iOS Help => Topic started by: BlueSquirrel 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
-
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)
-
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!!
-
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?
-
Yes, but I'd need to see how your current system works (screengrab the network)
-
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)