VR Museum
This is a demo video of the virtual museum I created for the Samsung Gear VR using Unity.
What Would You Do?
I created this game as a final project from one of my new media finals. It is a basic Unity creation that focuses on different NPC’s stories and forces the player to think about them and determine what they would do.
Background: For this project I wanted to further my work on my Autobotography assignment. I came up with this idea after one of my philosophy classes and wanted to create a game that explores the way people react to different moral situations. This project is a complete draft but there are more things that I would like to add to the game such as events that happen when the player is going through the dialogue. I also want the player to be able to respond to the dialogue and actually help the NPC get through their predicament and see the result of their actions. I also want to add more characters and environments as well as more in depth stories to go along with the characters.
Explanation: This assignment was to create a game in Unity that allowed people the opportunity to question their own understanding and ask themselves what would they do in certain situations. I also added some EcoArt into this project that shows some side effects of pollution. My goal for this project was to make something where people can explore and discover things that they may find interesting.
Credits: I used the feedback that I was given in class to allow the player to come up with their own interpretation of what they learned instead of telling them what stats they have points in. I also used the feedback to add an ominous aesthetic to the game and see how that affects the player. The game isn’t as creepy as I wanted it to be but I had limited resources to work with. I also used textures, sprites, and animations from Top Down 2D RPG Kit which was made by Troll Bridge Studios. Although this kit did come with scripts premade I decided to create my own code using tutorials and the Unity User Manual to better suit my game.
Mac Version NMD206_Final
PC Version Coming Soon!
Character Move Script — C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CharacterMove : MonoBehaviour {
Rigidbody2D rbody;
Animator anim;
public bool canMove;
// Use this for initialization
void Start () {
rbody = GetComponent<Rigidbody2D> ();
anim = GetComponent<Animator> ();
canMove = true;
}
// Update is called once per frame
void Update () {
Vector2 movement_vector = new Vector2(Input.GetAxisRaw(“Horizontal“), Input.GetAxisRaw(“Vertical“));
if (Input.GetKey (“escape“)) {
Application.Quit ();
}
if (!canMove)
{
rbody.velocity = Vector2.zero;
return;
}
if (movement_vector != Vector2.zero) {
anim.SetBool (“iswalking“, true);
anim.SetFloat (“input_x“, movement_vector.x);
anim.SetFloat (“input_y“, movement_vector.y);
} else {
anim.SetBool (“iswalking“, false);
}
rbody.MovePosition (rbody.position + movement_vector * Time.deltaTime * 5);
}
}
Dialogue Manager Script — C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DialogueManager : MonoBehaviour {
public GameObject dBox;
public Text dText;
public bool dialogActive;
public string[] dialogueLines;
public int currentLine;
private CharacterMove thePlayer;
// Use this for initialization
void Start () {
thePlayer = FindObjectOfType<CharacterMove> ();
}
// Update is called once per frame
void Update () {
if (dialogActive && Input.GetKeyDown(KeyCode.Space))
{
dBox.SetActive (false);
dialogActive = false;
}
}
public void ShowBox(string dialogue)
{
dialogActive = true;
dBox.SetActive (true);
dText.text = dialogue;
}
public void ShowDialogue()
{
dialogActive = true;
dBox.SetActive (true);
thePlayer.canMove = false;
}
}
Animation Script — C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class animation_Trey : MonoBehaviour {
Animator anim;
// Use this for initialization
void Start ()
{
anim = GetComponent<Animator> ();
}
// Update is called once per frame
void Update ()
{
float move = Input.GetAxis (“Vertical“);
anim.SetFloat (“Speed“, move);
}
}
Dialogue Holder Script — C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class dialogueHolder : MonoBehaviour {
public string dialogue;
private DialogueManager dMan;
public string[] dialogueLines;
// Use this for initialization
void Start () {
dMan = FindObjectOfType<DialogueManager> ();
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D( Collider2D other)
{
if (other.gameObject.name == “Player“)
{
dMan.ShowBox (dialogue);
}
}
}