Home Artists Posts Import Register

Content

This script let's you teleport objects freely to a fixed position, 

Excellent use if you want to have a script that

"If player opens door -> Teleport object to this position" to prevent having duplicated objects taking up storage

position

rotation

localScale


Remove the comments " // " on networking if you would like it to sync between players as well.

public class "FileName" : UdonSharpBehaviour

{

    public GameObject[] targets;


    public override void Interact()

    {

        for (int i = 0; i < targets.Length; i++)

        {

            //Networking.SetOwner(Networking.LocalPlayer, targets[i]);

            targets[i].transform.position = new Vector3(X,Y,Z);

            targets[i].transform.rotation = Quaternion.Euler(X,Y,Z);

            targets[i].transform.localScale = new Vector3(X,Y,Z);

        }

    }

}


Have fun!

Comments

No comments found for this post.