This script is attached to the player:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class door : MonoBehaviour
{
void OnTriggerEnter(Collider obj)
{
var thedoor = GameObject.FindWithTag("SF_Door");
thedoor.GetComponent< Animation > ().Play("open");
}
void OnTriggerExit(Collider obj)
{
var thedoor = GameObject.FindWithTag("SF_Door");
thedoor.GetComponent< Animation > ().Play("close");
}
}
Also this script is attached to the player:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PointAndClick : MonoBehaviour
{
public float moveSpeed = 50;
private Vector3 originalPosition;
void Start ()
{
originalPosition = transform.position;
}
void Update()
{
if (transform.position.z < 100)
transform.position += Vector3.forward * Time.deltaTime * moveSpeed;
}
}
To the player i added also a Rigidbody component.
The door i added a component box collider.
I tried to play with the box collider is trigger to check/uncheck it.
I also tried to play with the rigidbody on the player check/uncheck the is kinematic if not checked the player is falling down.
All the cases i tried not working.
I added a break point on the OnTriggerEnter in the door script and it’s never getting there.
In the screenshot on the left the Hierarchy the Platform and Doors are just empty GameObjects.
On Door_Prefab i added a box collider and the is trigger is checked. And the box collider size is set to x = 10 y = 10 z = 10
Then Player is also empty GameObject that i added to it the Rigidbody attached the two scripts and also added to it a box collider.
Tried to play on both the door and player box collider is trigger check/unchecked nothing was working.

Thanks, This is for a 2D game, I can limit it to avoid pixelation. I can also tune it later as needed. Right now the issue is that I can't load a clear image from disk.
– RalphTrickey