Hello,
I want to add a teleport in my Lego Microgame project, but I have no any Teleportation(?) Behaviour Brick if you have a link how to do the Lego teleport then please let me know!
Dear Unity creators, please add the Teleport Behavior Brick in new version of Unity Lego Microgame!
I need teleport. Please help me.
how activate my teleport script? In Touch Trigger? Player Minifig dont move. Help!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class followTV : MonoBehaviour
{
public GameObject player;
public GameObject player2;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
player2.transform.position = player.transform.position;
}
}
WOW! I know how do it!
player - the item you’re teleporting to
player2 - Minifig
offset - the distance between Minifig and the object you’re teleporting to
T - button activate the teleporter
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class followTV : MonoBehaviour
{
public GameObject player;
public GameObject player2;
private Vector3 offset = new Vector3(10, 0, 25);
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.T))
{
player2.transform.position = player.transform.position + offset;
}
}
}
The final version of the LEGO Minifig teleport!
- After teleport trigger have been activated
myTrigger.gameObject.name == “Player Minifig”
We need to turn off the Minifig Character Controller (see pic.)
player2.GetComponent().enabled = false; - the LEGO Minific is being teleported
player2.transform.position = player.transform.position + offset; - We need to turn on the Minifig Character Controller
player2.GetComponent().enabled = true; - don’t forget to add a line at the beginning
using Unity.LEGO.Minifig;
The script is available here: GitHub - hilux5/Unity: Unity LEGO Microgame
using System.Collections;
using System.Collections.Generic;
using Unity.LEGO.Minifig;
using UnityEngine;
public class Trigger : MonoBehaviour
{
public GameObject player;
public GameObject player2;
private Vector3 offset = new Vector3(10, 0, 25);
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter(Collider myTrigger)
{
if (myTrigger.gameObject.name == “Player Minifig”)
{
Debug.Log(“Box went through!”);
player2.GetComponent().enabled = false;
player2.transform.position = player.transform.position + offset;
player2.GetComponent().enabled = true;
}
}
}
add VideoCam in LEGO Minifig teleport
-
Add the Camera and New Rendered Texture
-
add New Rendered Texture teleported box
a Console:
There are 2 audio listeners in the scene. Please ensure there is always exactly one audio listener in the scene.
to solve the problem, you need to turn off the Teleport camera sound - Audio Lestener
I so want a teleport brick as well!!!
is this a joke? Please see my teleport’s video!
I did its not the teleporting brick that I’m looking for, would rather not have a render texture or an extra camera.
I would rather have a brick that when stacked onto other lego bricks would either
A. teleport the players from one spot to another spot that’s been linked to each other
or
B. teleports the players to a new scene but doesn’t count as a win, this would be helpful for a hub like level where players can jump into a different number of ports and then enter a level. think like Mario for the Nintendo 64.
I have no any Nintendo
My script TrigerNewScene please:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class TrigerNewScene : MonoBehaviour
{
public GameObject player2;
public string sceneName = “”;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void LoadScene()
{
SceneManager.LoadScene(sceneName);
}
void OnTriggerEnter(Collider myTrigger)
{
if (myTrigger.gameObject.name == “Player Minifig”)
{
Debug.Log(“Minifig went through!”);
player2.GetComponent().enabled = false;
LoadScene();
player2.GetComponent().enabled = true;
}
}
}
https://play.unity.com/mg/other/webgl-builds-18190
you can play and see my Portal
Did you modify your teleport script to allow it to teleport to new scenes? cause if I’m reading the image and code correctly that’s what it seems that you have done. Sorry, I’m not a coder by any means.
I don’t understand what the tp code is. Please see my script TrigerNewScene
I didn’t change anything, I just wrote a script and used it.
Oh… lol sweet that is a very helpful script for making a hub-like world.