Forum rules - please read before posting.

Moving around stopped working

Hi guys, I'm sure this is super simple to resolve! I'm new to Adventure Creator, I've been searching the forums and skipping round the manual, still I'm not sure what to do without doing my scene over again so appreciate a tip!

I have a scene.. All worked well, camera followed the player, navmesh works, tintmaps, looks great. I accidentally deleted my camera and saved over it. Now if I insert a new camera via 'Create' button by 'Default Camera' in the Scene menu... the camera works and follows the player, but when I click anywhere, the player will no longer move around.

This is probably something really simple, a checkbox somewhere I need to recheck, I currently can't work out what! Apologies for the 'newbie' question. Cheers!

Comments

  • edited April 2017
    The camera you deleted was the default GameCamera or the MainCamera? The MainCamera can't be replaced by just adding a new GameCamera from the Scene Manager, you need to create a regular Camera, tag it MainCamera and add the AC "MainCamera" script to it. Some screenshots of your hierarchy (showing all your cameras and main camera) would be really helpful here.
  • Welcome to the community, @M1ke.

    Indeed - this is likely due to the main camera not being defined as it should be.  AC will rely on the MainCamera for any clicks you make to the scene, so if it's not present or not following your GameCamera correctly, there'll be an issue.

    To bring back the MainCamera, click on either of the Organise room objects buttons at the top of the Scene Manager.  That should reconfigure your scene if anything was accidentally removed.

    Otherwise, as @Alverik says, screenshots of your hierarchy - and detail of any messages in your Console - will be necessary.
  • Hey guys, thanks for the replies and the welcome. I added the "MainCamera" script as Alverik suggested (and it's tagged as "main camera") and that got it, can move around again. Phew! Next issue as a result of that is that now, for some reason that camera will now turn off as soon as I run the game. I have to pause unity and re-enable it and unpause. Have presssed the Organise room objects and hasn't mentioned to sort it this time.

    I have 1 other camera in the scene which I'm using to make a security TV camera type thing, so I'm unsure if thats affecting anything. Below is a screenshot of the main camera which is turning off, the scene manager and the other camera just in case.

    https://www.dropbox.com/s/fjc6x6sf79etzr5/ac1.png?dl=0


    The initial console message is:
    "Note: The MainCamera is parented to an unknown object. Be careful when moving the parent, as it may cause mis-alignment when the MainCamera is attached to a GameCamera."

    Oh the main camera is under the Cameras/_GameCamera hierarchy.

    Thanks guys, sorry - early days with AC!
  • edited April 2017
    Remove the GameCamera2D script from the MainCamera. I don't use 2D much, but the way AC deals with cameras usually goes like this: Main Camera deals with all display. GameCamera scripts then disable the Camera component in their GameObject. Then, the MainCamera then simply mimics the position and settings of the those "fake" or "deactivated" camera objects. In this case, the GameCamera2D component is most likely disabling the Camera component in your MainCamera. So as I mentioned, removing the GameCamera2D script will likely fix the situation.
  • Exactly.  If the object you've screenshotted was tagged as MainCamera before, AC may have gotten confused and tried to "fix" it by adding the MainCamera script when your organised the room objects.

    You can copy your GameCamera2D component and paste its values into a new GameCamera2D prefab created in the Scene Manager to retain the changes you made to it.  Once separated, I'd actually recommend removing that GameObject completely and place in the MainCamera prefab manually - you can find it in Assets/AdventureCreator/Prefabs/Automatic/MainCamera.
  • A-ha! Nice one, thanks a lot guys, appreciate the help on this and the positive vibes! :)
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.