Forum rules - please read before posting.

2D first-person navigation for touch screen by dragging

edited August 2016 in Technical Q&A
Hi,

I'm using AC for developing an unconventional project: an interactive book app for iOS. Basically, I have a 2D project in which the user should be able to move the camera freely in X/Y axis by touching and dragging. There is no actual "player."

What I couldn't figure out exactly is what sort of settings to use for this purpose (Movement Method, Touch Screen Settings, and camera implementation). What would be the best combination of settings?

I tried a few things, including setting up a player prefab, attaching a first-person camera to it, trying different movements methods such as Drag or First-person, and so forth. None of them were ideal for my purpose so far. The dragging of the camera doesn't response properly with the settings I tried. 

Thanks for the help!

Comments

  • You don't need a Player prefab if there is none to control.  Set your Movement method to None and ignore the Player prefab setting.  The First Person camera is intended for 3D FPS games - you can't trick it into working another way.

    If your Camera perspective is Unity 2D, you'll have the option to create a GameCamera 2D Drag in your Scene Manager's list of prefabs.  That should allow you to drag by clicking/dragging around the scene.
  • Thanks for the quick response. 

    I added a GameCamera2DDrag. However, the scene manager won't recognize it (see the attached image), and I still can't drag the camera.

    I set the movement method to none; input method to touch screen; and camera perspective to Unity 2D. I unchecked all the touch screen settings; tagged the GameCamera2DDrag with the same name.

    Unity 5.3.4f1, AC 1.53.

    image
  • Hello again, 
    I figured a way out: I noticed that when I start the game, the active camera was still the default "Main Camera." By creating an OnStart Cutscene, I switch to the 2D_Drag camera at the beginning.
  • The MainCamera should always be the active one - AC's camera system works by having the MainCamera copy the values of whichever "Game camera" you want active (see Section 4.1 of the Manual).

    To make your desired GameCamera the active one when the scene begins, drag it into the "Default camera" field in the Scene Manager.
  • I tried that before, but I can't locate it. Shouldn't Default Camera field be located in the below panel? https://postimg.org/image/p9bpnwhl3/
  • It will appear once you have assigned a Default PlayerStart, though this should have been created automatically for you.
  • Thanks! I thought I wouldn't need the player start, since I don't have a player. :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.