the idea is simple: in a 3D environment, when you fall off the terrain, i want the player to keep falling down until the same terrain starts to show up again. you know what i mean! like in pac-man, where the right side of the screen goes to the left side. is it possible in unity? if so, is it easy or hard? i’m super new to this! i tried googling this question, but, i don’t know how to properly describe what i mean, so i can’t find anything…
What you’re going to want is a “teleport script” for this application. Create a new game object (A box most likely) and change the box collider to “trigger.” Then add something like this to the box:
using UnityEngine;
public class Teleporter : MonoBehaviour
{
private Transform myTransform; // This is Pac Man's position. It will update as he moves.
public GameObject newPosition; // This is where you can drag-and-drop the Game Object with the position you want Pac Man to go if he hits the trigger attached to this object.
// Presumably on the other side of the map.
void Start(){
myTransform = GameObject.FindWithTag ("Player").transform.position;
}
void OnTriggerEnter ( Collider other )
{
//if Pac Man enters this box's trigger
myTransform = newPosition.transform.position;
}
Put a cube underneath the level, then add a boxcollider onto that. Set the collider as a trigger. then in a script use the funtion
(written in psuedo code)
void OnTriggerEnter()
{
playerPosition = moveUp;
}
you should watch some tutorials
http://unity3d.com/learn/tutorials/modules/beginner/physics/colliders-as-triggers
if the player is moved up by say 1000 units in one frame, he/she wont notice the difference (unless while under the level they can look up and see it, then it would disappear)
made a quick package here for you
https://www.dropbox.com/s/8rjzhcrhwavipr2/levelFall.unitypackage?dl=0