0

I am using the UnityOSC library by Joe Garcia to send OSC messages from the Unity Game Engine with the AngryBots demo with help from Joe Garcia's manual on using the library. I am a little confused as to how the files are to be used. Do I just import the files into the current Unity Project, or are they somehow installed as a specific library? Once imported into the project, do I then create a new C# asset and call functions or do I just attach the OSCHandler script to the object I want to send OSC from. When trying to create a new C# asset, I get compiler errors when trying to use the functions like OSCHandler.SendMessagetoClient(); as requiring an object reference for a non-static function. I prefixed 'static' to the functions in OSCHandler, but it just brings up more similar errors in the Unity Console, and it doesn't seem to be the right way of getting around the problem.

Aditya Tb
  • 21
  • 6

1 Answers1

1

You need to call those functions through a non-static instance of the class, which you can access with OSCHandler.Instance i.e.

OSCHandler.Instance.SendMessageToClient();
hjpotter92
  • 78,589
  • 36
  • 144
  • 183