Hi folks,

I thought I'd play with a 3D object menu where clicking on an object in the scene starts the game etc rather than a 2D menu. But there are issues...

I've got a script set up on the 'new game' object;

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class NewGame : MonoBehaviour {
void OnMouseDown() {
SceneManager.LoadScene("TempScene");
}
}


I have an empty object in TempScene that calls the start up event automatically, the event is your bog standard Join Active Group > Spawn Player.

Everything seems to be working except the camera. I can move the character (well, the stand-in object anyway) but the camera isn't attached to him.

Am I missing some code or Event steps?

Thanks for the help,
- Jon
  • Hello @simplex409 maybe I´m not getting it well, but seems you are expecting the Camera to be parented to the Player GameObject?
  • Hi RustedGames, thanks for replying :)

    Sort of I suppose. When you hit 'New Game' using the menu as normal, the camera is parented/setup dependant on the settings you've selected in ORK; it doesn't need parenting to the player object or anything else.

    My problem is that it's not setting up the main camera as it normally would - it's just leaving it sitting there.
  • edited April 2016
    Is the Camera tagged as "Main Camera", otherwise Ork will not find it to add the Camera Controls
    Post edited by RustedGames on
  • Yep, the camera is tagged as main.
  • Can you share a screenshot of the Unity hierarchy panel and the Base Control Setup within ORK?
  • Thanks, can you tell if when you hit the Play button the Camera Control component is added to the camera?
    Also check if inside your MainMenu scene, where the ORK startup GameObject is placed, check if the ORKProject file being loaded is the same you are saving in the Editor. I just reported a bug.
  • Nope, no component is added to the camera.

    The only changes are the appearance of the player model and the _ORK handler thingie. The Ork Project is still the same one.

    Checking and, if I go into the Ork Game Starter and enable Call Main Menu, then I can use the New Game button there with no issue - the camera and controls all work fine.
  • Since you're using custom code to start your game without using ORK's main menu, you'll need to start ORK's game as well (beside having a game starter somewhere before that to initialize ORK).

    ORK.Game.NewGame(bool loadScene);
    If loadScene is true, ORK will load the new game scene, otherwise it wont.
    In any case it'll start the start event if you've set it up.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you so much - that was driving me absolutely bonkers!
Sign In or Register to comment.