hello everyone.
i would just say i'm sorry for my bad english, i'll do my best to be more clear as possible.
i'm doing some practice with Unity and C# and right know i'm trying to understand how to emulate the RE7 door system, where the player hands are going to push the door when is closest to it, i found a tutoria for UE4 on youtube but nothing for unity..
what i actually have is a raycast to detect when i'm in front of the door, i can just open it by call an animation on some button press but i want to emulate it, but i'm totally confused on how to do it
this is my code for now
private void CheckTheHittingDoor()
{
var fdw = transform.forward;
RaycastHit hit;
if(Physics.Raycast(transform.position,fdw,out hit,raycastLenght))
{
for (int i = 0; i < _doors.Length; i++)
{
if(hit.collider.CompareTag(_doors[i]))
{
Debug.Log(_doors[i]);
}
}
}
}
then this is the video link from youtube to show you what i mean.
thank's you in advance