I have also tried just Vector3, with out normalized... not sure what to do or where to look. The DLL mentions Vector 3 a lot. Any ideas how to get this to work?Code:var destination = new UnityEngine.Vector3(100,100,100).normalized;
Saving a vector to variable, UnityEngine is not defined (JS)
Discussion in 'Rust Development' started by SomethingFishy, May 20, 2016.
-
Wulf Community Admin
Try global.UnityEngine instead.
-
was looking at var UnityEngine = importNamespace("UnityEngine"); but no luck there... will try global and update the posts
[DOUBLEPOST=1463773928][/DOUBLEPOST]global is not defined.
global is not definedCode:var bumFights = { Title : "BumFights", Author : "Brimstone", Version : V(0,1,0), Description : "Let's spawn some people in and give them weapons", HasConfig : false, Init: function (){ print("[BumFights]Added Chat Commands"); command.AddChatCommand('test', this.Plugin, 'Smile') }, Smile: function (player, command, arg) { rust.SendChatMessage(player, "bumFights", "SMILEEEe", "0"); var destination = global.UnityEngine.Vector3(100,100,100); //rust.ForcePlayerPosition(player, destination); }, }Last edited by a moderator: May 20, 2016 -
A normalized vector is probably not what you're looking for.
A normalized vector is a vector with a length of 1, (n = v / |v|)Last edited by a moderator: May 20, 2016 -
That is interesting and complex lol....
I kind of just gave up on making a variable reference a unity vector and just used oxide's rust.ForcePlayerPosition(player, 100,100,100);
still kind of annoying I could not get UnityEngine to work
