So I am trying to fix the last part of this MMO tutorial I am doing. Some of the code beforehand in other scripts needed changing, and Unity has not accepted it, except for this last script which i cannot get to work. The tutorial is here: http://www.unifycommunity.com/wiki/i...rtFox_tutorial Unity defines the problem on line 7, where it says public static class SmartFox { The script is here: using UnityEngine; using SmartFoxClientAPI; // Statics for holding the connection to the SFS server end // Can then be queried from the entire game to get the connection public class SmartFox : MonoBehaviour { private static SmartFoxClient smartFox; public static SmartFoxClient Connection { get { return smartFox; } set { smartFox = value; } } public static bool IsInitialized() { if ( smartFox != null ) { return true; } return false; } } any help would be appreciated, this is the final bug fix for the build I am fairly new to unity and don't have that much coding experience, so can't really identify problems.
Likely it means you already have another class/script called SmartFox elsewhere. Rename this static class or the other script.
I changed the names of the script and nothing, what's confusing is that you have two SmartFox scripts, one from the island demo for SFS and the other one that you copy from here: http://www.unifycommunity.com/wiki/index.php?title=BOX1_-_SmartFox.cs_script they are both called SmartFox, i don't know if that's confusing Unity?
I have rejigged the folders, that changed something. I named them both SmartFox, as they originally were named, then Unity told me to rename one of them. I did, and now the same problem lies in this script: using UnityEngine; using SmartFoxClientAPI; // Statics for holding the connection to the SFS server end // Can then be queried from the entire game to get the connection public static class SmartFox { private static SmartFoxClient smartFox; public static SmartFoxClient Connection { get { return smartFox; } set { smartFox = value; } } public static bool IsInitialized() { if ( smartFox != null ) { return true; } return false; } } line 7 again, the namespace 'global::' already contains a definition for 'SmartFox'
I tried changing some names and I don't get that error any more, but i get these three: Assets/network/NetworkTransform.cs(8,14): warning CS0659: `NetworkTransform' overrides Object.Equals(object) but does not override Object.GetHashCode() Assets/Scripts/ChatController.cs(21,22): warning CS0414: The private field `ChatController.sendingMessage' is assigned but its value is never used Assets/Scripts/gui_Game.cs(15,17): warning CS0414: The private field `gui_Game.myId' is assigned but its value is never used
OK, that problem has gone now, no idea how, i reloaded the project, except now i have animation problems...
I now have a playable version but there are still some error messages, I will look into it, but I'm going to test the cross LAN networking first
I deleted the SmartFox script from the Network folder and this seemed to clear up everything. Apparently the two scripts are identical it's just that the demo stuck it in the network folder and the tutorial has it outside.
I got this error... I already deleted the SmartFox script from the Network folder...when iam trying to move a player it display some errors like "Unity Web Player [version: Unity 4.3.3f1_c8ca9b6b9936] mono-1-vc.dll caused an Access Violation (0xc0000005) in module mono-1-vc.dll at 001b:045d651e." also stuck the demo.... how to solve this problem.... thanks in advance