- Home /
player prefs, saving the Rect of a gui position?
ive tried this, saving across server, and i got rpc error
Sending RPC failed because 'saveMyCharacterToServer' parameter 44 (UnityEngine.Rect) is not supported. UnityEngine.NetworkView:RPC(String, RPCMode, Object[]) traitorSystem:SaveMyCharacter() (at Assets/scripts/traitorSystem.js:640) $:MoveNext() (at Assets/scripts/traitorSystem.js:596)
is this unallowed or is my code not allowing it lol any help would be grand
Answer by whydoidoit · Mar 20, 2013 at 08:48 PM
You can't send a rect by RPC - you need send the individual elements of the rect as separate parameters and reconstruct on the other end.
ahh this was the conclusion i was fearing actually haha, thanks for the very fast reply
You have one other choice. You can serialize lots of things to a byte[] send that and rehydrate on the other end. You could check out this article
thanks again, and thanks for the article, i have already saved the .x and .y positions of rect as floats, and it works well
Your answer
Follow this Question
Related Questions
Organizing Player Prefs? 1 Answer
Multiple Save (Saving & Loading System) With PlayerPrefs 2 Answers
C# Script issue with Player 1 Answer
Problem with identifying players in network 1 Answer
Integration of Unity whithin GUI (ex QT) 2 Answers