Question by
horncolor · Aug 31, 2020 at 07:52 AM ·
vector3transform.position
Problem with setting players location in WebGL
Hello! I'm currently working on a 3D URP project. I want to teleport my first person player from his current position to another position, that is set by a GameObejct in a Vector3 variable. In Unity this works perfectly, but when I build the project for WebGL and load it onto the server, my player gets teleported to a different position than it should be.
This is the function for the teleportation:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MapProduct : MonoBehaviour
{
public Map map;
public GameObject player;
public void GoToProduct()
{
player.transform.position = map.activeProduct.viewPoint; //this references the Vector3 variable from another script
}
}
Have you ever faced that issue and know what's the problem? Thanks for your help!
Comment
Your answer
