OnCollisonEnter refrence not working

I am trying to make a game where a rolling ball picks up items with rigidbodies as a proof of concept, however I keep getting the error message: “‘transform’ is not a member of ‘object’”. I use boo for scripting so that might be the problem. The code:

import UnityEngine

class ParentOnCollide (MonoBehaviour):

def Start ():
	pass

def Update ():
	pass

def OnCollisonEnter(NewCollide):
	NewCollide.transform.parent = gameObject.transform.parent

def OnCollisonExit(NewCollide):
	NewCollide.transform.parent = gameObject.transform.parent.transform.parent

col in Noob_Vulcans comment should be replaced by the name of your Collision as defined in the function argument.

But in your code you have missed the Collision definition and the return type

def OnCollisonEnter(NewCollide as Collision) as void:

I have noticed in JS that, even though you should be able to access the collision transform directly, sometimes it makes you go through the gameObject, just as Noob_Vulcan stated.

Look at this page:

Select Boo from the “Scripting Reference using” dropdown box.