Hiya,
I'm trying to paste a base back using TryPasteFromVector3 but I get a NRE when I load my CS file.
The relevant code is below:
void Init() {
var position = new Vector3(-393.7489f, 19.02035f, 1276.887f);
float rotation = 3.7f; // rotationdiff
PasteBackBuilding(position, rotation, "base-1");
}
bool PasteBackBuilding(Vector3 position, float rotation, string filename) {
var options = new List<string>{ "blockcollision", "true" };
var success = CopyPaste.Call("TryPasteFromVector3", position, rotation, filename, options.ToArray());
Puts("Success: " + success);
return true;
}But all I get as an error is the following:
22:44 [Error] Failed to initialize plugin 'CopyPasteBasePaster v2020.6.29' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.CopyPasteBasePaster.BuyBuilding (UnityEngine.Vector3 position, System.Single rotation, System.String filename) [0x0004d] in <02823facea474d6687b86173514a5bf1>:0
at Oxide.Plugins.CopyPasteBasePaster.Init () [0x0001c] in <02823facea474d6687b86173514a5bf1>:0
at Oxide.Plugins.CopyPasteBasePaster.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00032] in <02823facea474d6687b86173514a5bf1>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <1e2d7ad0801a4037ab6a24578c814b54>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <1fe782f4b27a43ae85d29ebb2d56c007>:0
at Oxide.Core.Plugins.CSPlugin.HandleAddedToManager (Oxide.Core.Plugins.PluginManager manager) [0x00043] in <1fe782f4b27a43ae85d29ebb2d56c007>:0 I've been staring at this too long and I can't see the issue :(
Thanks in advance for any help!