Short of it:
Doing a basic game on gender reveal. My wife and I are new to Unity, but we figured it would be better than RPGMaker which we did the birth reveal with, since few could actually play the RPGMaker finished game.
But… we are just learning C#.
Problem:
Similar to the Roller Ball tutorial, we collect objects. The object count goes up (working fine), and when we hit 6 objects collected, we need it to either:
A) Switch to a top camera viewing the whole map (the land spells out “It’s a Boy!”
B) Switch to a new Scene with that camera (maybe easier?)
or
C) Bring up a JPEG of a screen capture of the overview.
I assume it is attached to the PlayerController script. Here is what we have on that (the question makes in the last lines is where I THINK something should happen):
using UnityEngine.UI;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
public Text countText;
public Image winView;
private Rigidbody rb;
private int count;
void Start ()
{
rb = GetComponent<Rigidbody>();
count = 0;
SetCountText ();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag ( "Pick Up"))
{
other.gameObject.SetActive (false);
count = count + 1;
SetCountText ();
}
}
void SetCountText ()
{
countText.text = "Count: " + count.ToString ();
if (count >= 6)
{
?????
}
}
}
So, the other part is we need to do this gender reveal ASAP (Christmas is coming up!). Since we are noobs on a time schedule, but committed to learning Unity long term, we would appreciate clear instructions of what we are doing wrong and step by step how to make it right. In viewing forums, I’ve seen some thing like “Insert this !” but I have no idea where it would go.
Thanks for your awesomeness!