I'm using this class for the EventeReceiver :
Code: Select all
Public Class MyEventReceiver
Implements IEventReceiver
Public Function OnEvent(ByVal e As [Event]) As Boolean Implements IEventReceiver.OnEvent
If e.Type = EventType.KeyInput Then
'37=leftkey,38=upkey,39=rightkey,40=downkey,
If e.Key = 38 Then
Console.Write("Du har presset meg")
End If
End If
Return False
End Function
End Class
Code: Select all
device.EventReceiver = New MyEventReceiver()
An unhandled exception of type 'System.NullReferenceException' occurred in irrlicht.net.dll
Additional information: Object reference not set to an instance of an object.
If i drop the device.EventReceiver, the rest of the kode works fine...
What could I be doing woring??
Code: Select all