Hi,
I have this weird issue even though I am Getting Debug my code is not working. Also Note that it is not working only for my machine for whether its editor or build, it is working well in every other computer.
Here is my code Though.
I am getting logs very well its just not transforming position.
public void OnTriggerEnter(Collider other)
{
Debug.LogError("General collider detected " + other.gameObject.name);
if (other.gameObject == GameManager.Instance.LocalObject && chek)
{
Debug.LogError(“Our Local Player Detected”);
if (this.gameObject.name == “PortalTunnel collider 1”)
{
Debug.LogError(“Game Object Transform entered from 1”);
GameManager.Instance.LocalObject.transform.position = TransformLocation2.transform.position;
GameManager.Instance.LocalObject.transform.rotation = TransformLocation2.transform.localRotation;
}
if (this.gameObject.name == “PortalTunnel collider 2”)
{
Debug.LogError(“Game Object Transform entered from 2”);
GameManager.Instance.LocalObject.transform.position = TransformLocation1.transform.position;
GameManager.Instance.LocalObject.transform.rotation = TransformLocation1.transform.localRotation;
}
// IsOtherCameraOn.SetActive(false);
With Physics (or Physics2D), never manipulate the Transform directly. If you manipulate the Transform directly, you are bypassing the physics system and you can reasonably expect glitching and missed collisions and other physics mayhem.
Always use the .MovePosition() and .MoveRotation() methods on the Rigidbody (or Rigidbody2D) instance in order to move or rotate things. Doing this keeps the physics system informed about what is going on.
Thank you for exact solution and I did not know about this detail about MovePosition and I agree with dots However it was fast run project with short deadline I also agree I don’t have habit to use code like that so I am glad you acknowledge that hence will work on that.
After Checking it again I am using character controller and no Rigidbody.
I am Using Photon and 3pp newInput character controller https://assetstore.unity.com/packages/essentials/starter-assets-third-person-character-controller-196526
also what I am saying is, It is working in every other PC but not in my particular PC in WebGL and Editor. Also Note that my PC is much high end I9 10900k , 32GB RAM 3600Mhz, 3070 Graphic card is it if there is something related to too much FPS(Overclocking) I don’t know.