Hello there!
I’m looking to change the bool of a raycasthit’s parent.
Current Script:
static var dTog : boolean;
var hit : RaycastHit;
function Update()
{
Debug.DrawRay (transform.position, transform.forward, Color.red);
if(Physics.Raycast(transform.position, transform.forward, hit, 100.0))
{
if(hit.collider.CompareTag("button"))
{
if(Input.GetKeyDown(KeyCode.E))
{
hit.transform.parent.thisD = !hit.transform.parent.thisD;
print("door is open/close");
}
}
}
}
Currently this gives me nothing but a “Enumerable 1 Error”.
Is there anything you guys can see wrong in it?
I would appretiate the help greatly!
Sincerely,
Bakos133