My code:
def OnTriggerStay(collisionInfo as Collider) as void:
player = GameObject.Find("Player")
direction = player.transform.position - transform.parent.position
hits = Physics.RaycastAll(transform.parent.position,direction)
i as int = 0
safe = false
while i<hits.Length:
if hits*.transform.tag == "Respawn":*
-
safe = true*
-
i++*
-
if safe == false:*
-
audio.PlayOneShot(alarmsound)*
-
script = GameObject.GetComponent("movement")*
-
script.enabled = false*
I get the following errors:
Assets/detection_script.boo(25,33): BCE0020: An instance of type ‘UnityEngine.GameObject’ is required to access non static member ‘GetComponent’.
and
Assets/detection_script.boo(26,20): BCE0019: ‘enabled’ is not a member of ‘UnityEngine.Component’.
Any idea where I’m going wrong? The documentation has no reference for Boo. Is this a JS only feature? If so, how can I do the same thing with boo?